Skip to content

Commit

Permalink
input: do not panic if window id can not be looked up
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon committed Jun 15, 2024
1 parent 41a8725 commit 11c58ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/input.b.v
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ fn (ip Input) sdl_to_shy_event(sdl_event sdl.Event) Event {
shy_window_id := Window.map_sdl_window_id_to_shy_window_id(sdl_event.window.windowID)
win := s.window(shy_window_id) or {
s.log.gerror('${@STRUCT}.${@FN}', 'unable to locate SDL/Shy window ${sdl_event.window.windowID}/${shy_window_id}: ${err}')
panic('${@STRUCT}.${@FN} unable locate SDL/Shy window ${sdl_event.window.windowID}/${shy_window_id}: ${err}')
s.log.gwarn('${@STRUCT}.${@FN}', 'dropping handling of window event ${sdl_event.window.windowID}/${shy_window_id}, returning unknown...')
// panic('${@STRUCT}.${@FN} unable locate SDL/Shy window ${sdl_event.window.windowID}/${shy_window_id}: ${err}')
return shy_event
}

match wevid {
Expand Down

0 comments on commit 11c58ee

Please sign in to comment.