diff --git a/src/gui_handler/gui/audible.rs b/src/gui_handler/gui/audible.rs index 25e03a5..15eec0f 100644 --- a/src/gui_handler/gui/audible.rs +++ b/src/gui_handler/gui/audible.rs @@ -1,7 +1,7 @@ //! `Audible` is a property to play a sound use crate::prelude::*; -use anyhow::Result; +use anyhow::{Result, anyhow}; use assetpath::AssetPath; // #[cfg(feature = "audio")] @@ -18,7 +18,12 @@ pub struct Audible { impl Audible { pub fn new(gui_handler: Arc, mut path: AssetPath) -> Result> { if !path.has_prefix() { - path.set_prefix(&gui_handler.resource_base_path().full_path()); + path.set_prefix( + &gui_handler + .resource_base_path() + .ok_or(anyhow!("resource base path not set!"))? + .full_path(), + ); } // TODO: