Merge pull request #33750 from lupoDharkael/gradient

GradientEdit: Fix index crashes
This commit is contained in:
Rémi Verschelde 2019-11-20 11:24:10 +01:00 committed by GitHub
commit 60711e6738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

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();