GradientEdit: Fix index crashes

This commit is contained in:
lupoDharkael 2019-11-19 22:05:03 +01:00
parent 7a0228fbba
commit 268fe9dda5

View file

@ -277,12 +277,13 @@ void GradientEdit::_gui_input(const Ref<InputEvent> &p_event) {
if (points[i].offset == newofs && i != grabbed) {
valid = false;
break;
}
}
if (!valid)
if (!valid || grabbed == -1) {
return;
}
points.write[grabbed].offset = newofs;
points.sort();