From 20fa2d8fb204b2b285922a3925a5a25388ca371f Mon Sep 17 00:00:00 2001 From: P-Chan Date: Tue, 4 Jan 2022 17:55:51 +0900 Subject: [PATCH] Fix runtime error when device is null Fix #904 --- components/metrics/RealtimeLog.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/metrics/RealtimeLog.js b/components/metrics/RealtimeLog.js index 81e25d2e..34de4e6a 100644 --- a/components/metrics/RealtimeLog.js +++ b/components/metrics/RealtimeLog.js @@ -137,7 +137,11 @@ export default function RealtimeLog({ data, websites, websiteId }) { ), browser: {BROWSERS[browser]}, os: {os}, - device: {intl.formatMessage(devices[device])?.toLowerCase()}, + device: + {devices[device] + ? intl.formatMessage(devices[device]).toLowerCase() + : intl.formatMessage({ id: 'label.unknown', defaultMessage: 'Unknown' })} + , }} /> );