diff options
Diffstat (limited to 'editor/plugins/curve_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index eeb8e998b9..a1a692bdd1 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -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; } } |