Skip to content

Commit

Permalink
fix: Handle unrecognized screen IDs in screen_name_for_id (#1842)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzimbel-mbta authored Aug 31, 2023
1 parent 7437166 commit af3cb8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/screens/log_screen_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ defmodule Screens.LogScreenData do
end

defp screen_name_for_id(screen_id) do
%Screen{name: name} = State.screen(screen_id)
name
case State.screen(screen_id) do
%Screen{name: name} -> name
nil -> "UNKNOWN_SCREEN"
end
end

defp insert_screen_side(data, nil), do: data
Expand Down

0 comments on commit af3cb8c

Please sign in to comment.