From 45a0b8b767f52f97a65836183497cf7bf99a341a Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 2 Aug 2023 12:38:48 -0700 Subject: [PATCH] Fix NPE in FileSharingView when no files have been shared --- lib/views/filesharingview.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/views/filesharingview.dart b/lib/views/filesharingview.dart index 9c517ad7..62fda176 100644 --- a/lib/views/filesharingview.dart +++ b/lib/views/filesharingview.dart @@ -37,7 +37,7 @@ class _FileSharingViewState extends State { future: Provider.of(context, listen: false).cwtch.GetSharedFiles(profileHandle, Provider.of(context).identifier), builder: (context, snapshot) { if (snapshot.hasData) { - List sharedFiles = jsonDecode(snapshot.data as String); + List sharedFiles = jsonDecode(snapshot.data as String) ?? List.empty(); sharedFiles.sort((a, b) { return a["DateShared"].toString().compareTo(b["DateShared"].toString()); });