Skip to content

Commit

Permalink
Fix opening dynamic links (#660)
Browse files Browse the repository at this point in the history
Issue was `Failed assertion: boolean expression must not be null`

Fixes #659
  • Loading branch information
nilsreichardt authored May 9, 2023
1 parent 2dae801 commit 5a7ac1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/lib/main/dynamic_links.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class DynamicLinkOverlay extends StatelessWidget {
return StreamBuilder<EinkommenderLink>(
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((_) =>
Expand Down

0 comments on commit 5a7ac1f

Please sign in to comment.