From af3cb8c018e1e6fd3c65498e6bfbf6331349c9c7 Mon Sep 17 00:00:00 2001 From: Jon Zimbel <63608771+jzimbel-mbta@users.noreply.github.com> Date: Thu, 31 Aug 2023 14:14:16 -0400 Subject: [PATCH] fix: Handle unrecognized screen IDs in `screen_name_for_id` (#1842) --- lib/screens/log_screen_data.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/screens/log_screen_data.ex b/lib/screens/log_screen_data.ex index c86c9c1ca..9f8679791 100644 --- a/lib/screens/log_screen_data.ex +++ b/lib/screens/log_screen_data.ex @@ -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