Skip to content

Commit

Permalink
remove expect from fallible code, would crash if handling this outsid…
Browse files Browse the repository at this point in the history
…e of winit
  • Loading branch information
TotalKrill committed Nov 18, 2021
1 parent 265a8f1 commit 4f11b67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/platform_impl/web/web_sys/canvas/pointer_handler.rs
Expand Up @@ -79,9 +79,10 @@ impl PointerHandler {
event::mouse_button(&event),
event::mouse_modifiers(&event),
);
canvas
.set_pointer_capture(event.pointer_id())
.expect("Failed to set pointer capture");
let e = canvas.set_pointer_capture(event.pointer_id());
if !e.is_ok() {
log::error!("{:?}", e);
}
},
));
}
Expand Down

0 comments on commit 4f11b67

Please sign in to comment.