mirror of
https://github.com/godotengine/godot.git
synced 2025-10-30 13:11:13 +00:00
Fix Curve Editor crash with null curve
This commit is contained in:
parent
37d1dfef9d
commit
beae9b0bc1
2 changed files with 10 additions and 6 deletions
|
|
@ -978,9 +978,11 @@ void CurveEditor::_notification(int p_what) {
|
|||
} break;
|
||||
case NOTIFICATION_READY: {
|
||||
Ref<Curve> curve = curve_editor_rect->get_curve();
|
||||
// Set snapping settings based on the curve's meta.
|
||||
snap_button->set_pressed(curve->get_meta("_snap_enabled", false));
|
||||
snap_count_edit->set_value(curve->get_meta("_snap_count", DEFAULT_SNAP));
|
||||
if (curve.is_valid()) {
|
||||
// Set snapping settings based on the curve's meta.
|
||||
snap_button->set_pressed(curve->get_meta("_snap_enabled", false));
|
||||
snap_count_edit->set_value(curve->get_meta("_snap_count", DEFAULT_SNAP));
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue