diff --git a/lib/routes/security_pin/security_and_backup/security_and_backup_page.dart b/lib/routes/security_pin/security_and_backup/security_and_backup_page.dart index c6ba74e19..d4b45ff27 100644 --- a/lib/routes/security_pin/security_and_backup/security_and_backup_page.dart +++ b/lib/routes/security_pin/security_and_backup/security_and_backup_page.dart @@ -169,8 +169,8 @@ class SecurityAndBackupPageState extends State } final backupSettings = backupSnapshot.data; - final isRemoteServer = - backupSettings.backupProvider?.isRemoteServer; + final isRemoteServer = (backupSettings != null && + backupSettings.backupProvider.isRemoteServer); return ListView( children: [ diff --git a/lib/widgets/enable_backup_dialog.dart b/lib/widgets/enable_backup_dialog.dart index 95ee71a15..08249b473 100644 --- a/lib/widgets/enable_backup_dialog.dart +++ b/lib/widgets/enable_backup_dialog.dart @@ -48,7 +48,8 @@ class EnableBackupDialogState extends State { } final backupSettings = snapshot.data; - bool isRemoteServer = backupSettings.backupProvider?.isRemoteServer; + bool isRemoteServer = (backupSettings != null && + backupSettings.backupProvider.isRemoteServer); return AlertDialog( titlePadding: const EdgeInsets.fromLTRB(24.0, 22.0, 0.0, 16.0),