mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-23 16:01:04 +01:00
Fix texture_as_hal internal unwrap may cause panic (#3131)
This commit is contained in:
1 parent
d81cb46be0
commit
dcc0baa1ff
1 file changed
+1
-1
@@ -385,7 +385,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let mut token = Token::root();
|
||||
let (guard, _) = hub.textures.read(&mut token);
|
||||
let texture = guard.try_get(id).ok().flatten();
|
||||
let hal_texture = texture.map(|tex| tex.inner.as_raw().unwrap());
|
||||
let hal_texture = texture.and_then(|tex| tex.inner.as_raw());
|
||||
|
||||
hal_texture_callback(hal_texture);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user