Layer Groups page crashes when trying to reorder layers

Description

The error is frequent but pretty random.

To reproduce:
Create a layer group of layer groups. (I think it can fail with simple layers too)
Open the LayerGroupEditPage
Reorder the Layers list with the mouse drag and drop untill it crashes.

Here's the stack trace

Environment

Linux

Status

Assignee

Andrea Aime

Reporter

Gnafu

Triage

Fix versions

Affects versions

Components

Priority

Low
Configure