From cdbeccc8a3d97988352d8fb23a183d51cb1e99c2 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 10 Apr 2026 07:27:43 -0500 Subject: [PATCH] [fix]: crash on missing video --- src/ui/video_editor.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ui/video_editor.rs b/src/ui/video_editor.rs index 86a2775..b1755d0 100644 --- a/src/ui/video_editor.rs +++ b/src/ui/video_editor.rs @@ -195,17 +195,23 @@ impl VideoEditor { fn update_entire_video(&mut self, video: &videos::Video) { debug!(?video); - let Ok(mut player_video) = - Url::from_file_path(video.path.clone()).map(|url| { - gst_video::create_video(&url, 60) - .expect("Shouldn't have probs") - }) - else { + let Ok(url) = Url::from_file_path(video.path.clone()) else { self.video = None; self.title.clone_from(&video.title); self.core_video = Some(video.clone()); return; }; + let Ok(mut player_video) = gst_video::create_video(&url, 60) + else { + self.video = None; + self.title = format!( + "{}: {}", + String::from("Video Missing"), + &video.title + ); + self.core_video = Some(video.clone()); + return; + }; player_video.set_paused(true); self.video = Some(player_video); self.title.clone_from(&video.title);