From e44f175350b95de25b84b66d9e41daa09f97f37a Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 7 Mar 2022 16:28:19 -0800 Subject: [PATCH] Fix error thrown when renderinging without a value --- web/components/offline-notice.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/web/components/offline-notice.tsx b/web/components/offline-notice.tsx index 5d872fe14..90d64eeab 100644 --- a/web/components/offline-notice.tsx +++ b/web/components/offline-notice.tsx @@ -29,6 +29,11 @@ export default function Offline({ logs = [], config }: OfflineProps) { const { streamKey, rtmpServerPort } = serverConfig; const instanceUrl = global.window?.location.hostname || ''; + let rtmpURL; + if (instanceUrl && rtmpServerPort) { + rtmpURL = generateStreamURL(instanceUrl, rtmpServerPort); + } + const data = [ { icon: , @@ -47,9 +52,11 @@ export default function Offline({ logs = [], config }: OfflineProps) { Streaming URL: - - {generateStreamURL(instanceUrl, rtmpServerPort)} - + {rtmpURL && ( + + {rtmpURL} + + )} Stream Key: