webgl: Don't panic when trying to draw unregistered bitmap
Avoids a panic in #1248.
This commit is contained in:
parent
4034ef8d79
commit
253c231788
|
@ -1048,12 +1048,14 @@ impl RenderBackend for WebGlRenderBackend {
|
|||
);
|
||||
}
|
||||
DrawType::Bitmap(bitmap) => {
|
||||
let texture = &self
|
||||
.textures
|
||||
.iter()
|
||||
.find(|(id, _tex)| *id == bitmap.id)
|
||||
.unwrap()
|
||||
.1;
|
||||
let texture = if let Some(texture) =
|
||||
self.textures.iter().find(|(id, _tex)| *id == bitmap.id)
|
||||
{
|
||||
&texture.1
|
||||
} else {
|
||||
// Bitmap not registered
|
||||
continue;
|
||||
};
|
||||
|
||||
program.uniform_matrix3fv(
|
||||
&self.gl,
|
||||
|
|
Loading…
Reference in New Issue