Guard against uninstantiated globals in tests

This commit is contained in:
Mikayla Maki committed 2023-07-03 13:48:17 -07:00
1 parent beb97e49c7
commit dbe2e418eb
1 file changed
+4
+4
View File
@@ -44,6 +44,10 @@ impl Audio {
}
pub fn play_sound(sound: Sound, cx: &AppContext) {
if !cx.has_global::<Self>() {
return;
}
let this = cx.global::<Self>();
let Some(output_handle) = this.output_handle.as_ref() else {