Fix NPE in FileSharingView when no files have been shared
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
3e6c3faeda
commit
45a0b8b767
|
@ -37,7 +37,7 @@ class _FileSharingViewState extends State<FileSharingView> {
|
||||||
future: Provider.of<FlwtchState>(context, listen: false).cwtch.GetSharedFiles(profileHandle, Provider.of<ContactInfoState>(context).identifier),
|
future: Provider.of<FlwtchState>(context, listen: false).cwtch.GetSharedFiles(profileHandle, Provider.of<ContactInfoState>(context).identifier),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasData) {
|
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) {
|
sharedFiles.sort((a, b) {
|
||||||
return a["DateShared"].toString().compareTo(b["DateShared"].toString());
|
return a["DateShared"].toString().compareTo(b["DateShared"].toString());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue