From 9aa7d527924443f88d24741b6689fd776f498c34 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 12 Apr 2021 20:48:33 +0200 Subject: [PATCH] fix: Minor sentry crashes --- lib/views/settings_notifications.dart | 4 ++-- pubspec.lock | 2 +- pubspec.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/views/settings_notifications.dart b/lib/views/settings_notifications.dart index f9371a38..6b82f7e2 100644 --- a/lib/views/settings_notifications.dart +++ b/lib/views/settings_notifications.dart @@ -189,10 +189,10 @@ class SettingsNotifications extends StatelessWidget { ), ); } - if (!snapshot.hasData) { + if (snapshot.connectionState != ConnectionState.done) { Center(child: CircularProgressIndicator()); } - final pushers = snapshot.data; + final pushers = snapshot.data ?? []; return ListView.builder( physics: NeverScrollableScrollPhysics(), shrinkWrap: true, diff --git a/pubspec.lock b/pubspec.lock index c1fb2a3b..885e78cc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,7 @@ packages: name: adaptive_page_layout url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.2.3" adaptive_theme: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 86866d4e..231cc632 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,7 +33,7 @@ dependencies: url_launcher: ^5.7.10 cached_network_image: ^2.5.0 flutter_local_notifications: ^3.0.3 - adaptive_page_layout: ^0.2.1 + adaptive_page_layout: ^0.2.3 provider: ^4.3.3 adaptive_theme: ^1.1.0 # desktop_notifications: ^0.0.0-dev.4 // Currently blocked by: https://github.com/canonical/desktop_notifications.dart/issues/5