Skip to content

Commit

Permalink
fixed crash when trying to create a scene after closing project exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed May 20, 2024
1 parent a013595 commit 8d96ef6
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions editor/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use crate::{
Message,
};
use cargo_metadata::{camino::Utf8Path, Metadata};
use fyrox::graph::SceneGraph;
use std::{
ffi::OsStr,
fmt::{Display, Formatter},
Expand Down Expand Up @@ -1063,16 +1064,14 @@ impl ExportWindow {
}

pub fn sync_to_model(&self, ui: &mut UserInterface) {
let ctx = ui
.node(self.inspector)
.cast::<Inspector>()
.unwrap()
.context()
.clone();

if let Err(sync_errors) = ctx.sync(&self.export_options, ui, 0, true, Default::default()) {
for error in sync_errors {
Log::err(format!("Failed to sync property. Reason: {:?}", error))
if let Some(inspector) = ui.try_get_of_type::<Inspector>(self.inspector) {
let ctx = inspector.context().clone();
if let Err(sync_errors) =
ctx.sync(&self.export_options, ui, 0, true, Default::default())
{
for error in sync_errors {
Log::err(format!("Failed to sync property. Reason: {:?}", error))
}
}
}
}
Expand Down

0 comments on commit 8d96ef6

Please sign in to comment.