fix(view): -VIEW settings open no undo step for a view that is gone

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-12 00:12:51 +03:00
1 parent e5df2fd113
commit a542a401d9
1 file changed
+3 -3
+3 -3
View File
@@ -270,11 +270,11 @@ impl OpenCADStudio {
/// One setting of -VIEW's sEttings option on the named view.
fn apply_view_setting(&mut self, i: usize, setting: &str, name: &str, value: &str) {
self.push_undo_snapshot(i, "-VIEW");
let document = &mut self.tabs[i].scene.document;
let Some(mut view) = document.views.get(name).cloned() else {
let Some(mut view) = self.tabs[i].scene.document.views.get(name).cloned() else {
return;
};
self.push_undo_snapshot(i, "-VIEW");
let document = &mut self.tabs[i].scene.document;
if view.handle.is_null() {
view.handle = document.allocate_handle();
}