From f10f767be6b48034bbd68700153f348123dde262 Mon Sep 17 00:00:00 2001 From: Adrien GIVRY Date: Tue, 29 Apr 2025 13:12:54 -0400 Subject: [PATCH] Fixed crash when an invalid asset is drag-dropped onto a surface field --- editor/src/plugins/inspector/editors/surface.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/editor/src/plugins/inspector/editors/surface.rs b/editor/src/plugins/inspector/editors/surface.rs index 0992f4abb..0012da7bb 100644 --- a/editor/src/plugins/inspector/editors/surface.rs +++ b/editor/src/plugins/inspector/editors/surface.rs @@ -108,14 +108,16 @@ impl Control for SurfaceDataPropertyEditor { }; if let Ok(path) = path { - if let Ok(value) = - block_on(self.resource_manager.request::(path)) + if let Some(request) = + self.resource_manager.try_request::(path) { - ui.send_message(SurfaceDataPropertyEditorMessage::value( - self.handle(), - MessageDirection::ToWidget, - value, - )); + if let Ok(value) = block_on(request) { + ui.send_message(SurfaceDataPropertyEditorMessage::value( + self.handle(), + MessageDirection::ToWidget, + value, + )); + } } } }