Fix NPE in FileSharingView when no files have been shared
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2023-08-02 12:38:48 -07:00
parent 3e6c3faeda
commit 45a0b8b767
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ class _FileSharingViewState extends State<FileSharingView> {
future: Provider.of<FlwtchState>(context, listen: false).cwtch.GetSharedFiles(profileHandle, Provider.of<ContactInfoState>(context).identifier),
builder: (context, snapshot) {
if (snapshot.hasData) {
List<dynamic> sharedFiles = jsonDecode(snapshot.data as String);
List<dynamic> sharedFiles = jsonDecode(snapshot.data as String) ?? List<dynamic>.empty();
sharedFiles.sort((a, b) {
return a["DateShared"].toString().compareTo(b["DateShared"].toString());
});