fix: backup restore failed

This commit is contained in:
lollipopkit
2023-08-29 10:53:38 +08:00
parent 57b72ae440
commit 1cdcff120d
2 changed files with 5 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ class Backup {
final List<ServerPrivateInfo> spis;
final List<Snippet> snippets;
final List<PrivateKeyInfo> keys;
final Map<String, String> dockerHosts;
final Map<String, dynamic> dockerHosts;
final Map<String, dynamic> settings;
Backup({

View File

@@ -176,7 +176,10 @@ class BackupPage extends StatelessWidget {
_privateKey.put(s);
}
for (final k in backup.dockerHosts.keys) {
_dockerHosts.put(k, backup.dockerHosts[k]!);
final val = backup.dockerHosts[k];
if (val != null && val is String && val.isNotEmpty) {
_dockerHosts.put(k, val);
}
}
context.pop();
showRoundDialog(