ShareDialog: catch & log unhandled err during collection path decryption
This commit is contained in:
parent
4939c4b089
commit
a9de0f9bb7
1 changed files with 9 additions and 7 deletions
|
@ -32,6 +32,7 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
bool _showEntryField = false;
|
||||
List<User> _sharees;
|
||||
String _email;
|
||||
final Logger _logger = Logger("SharingDialogState");
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -208,14 +209,14 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
final dialog = createProgressDialog(context, "sharing...");
|
||||
await dialog.show();
|
||||
final collection = widget.collection;
|
||||
if (collection.type == CollectionType.folder) {
|
||||
final path =
|
||||
CollectionsService.instance.decryptCollectionPath(collection);
|
||||
if (!Configuration.instance.getPathsToBackUp().contains(path)) {
|
||||
await Configuration.instance.addPathToFoldersToBeBackedUp(path);
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (collection.type == CollectionType.folder) {
|
||||
final path =
|
||||
CollectionsService.instance.decryptCollectionPath(collection);
|
||||
if (!Configuration.instance.getPathsToBackUp().contains(path)) {
|
||||
await Configuration.instance.addPathToFoldersToBeBackedUp(path);
|
||||
}
|
||||
}
|
||||
await CollectionsService.instance
|
||||
.share(widget.collection.id, email, publicKey);
|
||||
await dialog.hide();
|
||||
|
@ -260,6 +261,7 @@ class _SharingDialogState extends State<SharingDialog> {
|
|||
},
|
||||
);
|
||||
} else {
|
||||
_logger.severe("failed to share collection", e);
|
||||
showGenericErrorDialog(context);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue