From 42d4b34a9531f92d380cfe55aea2033a480d420c Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Tue, 9 May 2023 13:14:05 +0200 Subject: [PATCH] Fix opening dynamic links --- app/lib/main/dynamic_links.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/lib/main/dynamic_links.dart b/app/lib/main/dynamic_links.dart index 7a00ad1aa..9cd6cb549 100644 --- a/app/lib/main/dynamic_links.dart +++ b/app/lib/main/dynamic_links.dart @@ -23,7 +23,11 @@ class DynamicLinkOverlay extends StatelessWidget { return StreamBuilder( stream: einkommendeLinks, builder: (context, snapshot) { - if (snapshot.hasData && !snapshot.data.empty && activated) { + // Note: activated can be null, so need to use `activated == true` + // instead of just `activated`. Otherwise, you can easily a "Failed + // assertion: boolean expression must not be null", see + // https://github.com/SharezoneApp/sharezone-app/issues/659 + if (snapshot.hasData && !snapshot.data.empty && activated == true) { final einkommenderLink = snapshot.data; // If Notification is shown directly an Error as thrown, as it can't be displayed while this is still bulding (marked as dirty) Future.delayed(Duration(seconds: 1)).then((_) =>