1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fix Curve Editor crash with null curve

This commit is contained in:
MewPurPur
2023-06-13 11:35:35 +02:00
parent 37d1dfef9d
commit beae9b0bc1
2 changed files with 10 additions and 6 deletions

View File

@@ -265,9 +265,11 @@ void GradientTexture2DEditor::_notification(int p_what) {
snap_button->set_icon(get_theme_icon(SNAME("SnapGrid"), SNAME("EditorIcons")));
} break;
case NOTIFICATION_READY: {
// Set snapping settings based on the texture's meta.
snap_button->set_pressed(texture->get_meta("_snap_enabled", false));
snap_count_edit->set_value(texture->get_meta("_snap_count", DEFAULT_SNAP));
if (texture.is_valid()) {
// Set snapping settings based on the texture's meta.
snap_button->set_pressed(texture->get_meta("_snap_enabled", false));
snap_count_edit->set_value(texture->get_meta("_snap_count", DEFAULT_SNAP));
}
} break;
}
}