From 33ad784e87f99fcde7acfbfed25c44d8a32068d8 Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 30 May 2025 14:03:28 +0100 Subject: [PATCH] fix: missing stream hides live page --- lib/pages/live.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pages/live.dart b/lib/pages/live.dart index 52cba0f..99ef785 100644 --- a/lib/pages/live.dart +++ b/lib/pages/live.dart @@ -178,8 +178,8 @@ class _LivePage extends State final ev = streamState ?.sortedBy((e) => e.createdAt) .firstWhereOrNull((e) => e.getFirstTag("status") == "live"); - if (ev == null) return SizedBox(); - final stream = StreamEvent(ev); + + final stream = ev != null ? StreamEvent(ev) : null; return Stack( children: [ ApiVideoCameraPreview(controller: _controller), @@ -207,11 +207,11 @@ class _LivePage extends State ], ), ), - if ((stream.info.participants ?? 0) > 0) + if ((stream?.info.participants ?? 0) > 0) PillWidget( color: LAYER_2, child: Text( - t.viewers(n: stream.info.participants!), + t.viewers(n: stream?.info.participants ?? 0), style: TextStyle( color: Colors.white, fontSize: 14, @@ -348,7 +348,7 @@ class _LivePage extends State ], ), ), - if (_account != null) + if (_account != null && stream != null) Positioned( bottom: 80, child: Container(