From 4339f70d64ee8a044e106e962bbc8a35fdbcd053 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 11 Feb 2021 00:11:47 +1100 Subject: [PATCH] null fix --- lib/widget/category_display.dart | 6 ++++-- lib/widget/location_display.dart | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/widget/category_display.dart b/lib/widget/category_display.dart index 45db9435..64b8da88 100644 --- a/lib/widget/category_display.dart +++ b/lib/widget/category_display.dart @@ -110,7 +110,9 @@ class _CategoryDisplayState extends RefreshableState { int pk = category?.pk ?? -1; // Update the category - await category.reload(context); + if (category != null) { + await category.reload(context); + } // Request a list of sub-categories under this one await InvenTreePartCategory().list(context, filters: {"parent": "$pk"}).then((var cats) { @@ -317,7 +319,7 @@ class PartList extends StatelessWidget { } return ListTile( - title: Text("${part.name}"), + title: Text(part.fullname), subtitle: Text("${part.description}"), trailing: Text("${part.inStockString}"), leading: InvenTreeAPI().getImage( diff --git a/lib/widget/location_display.dart b/lib/widget/location_display.dart index 8d6b7b7c..ebaef9b5 100644 --- a/lib/widget/location_display.dart +++ b/lib/widget/location_display.dart @@ -115,7 +115,9 @@ class _LocationDisplayState extends RefreshableState { int pk = location?.pk ?? -1; // Reload location information - await location.reload(context); + if (location != null) { + await location.reload(context); + } // Request a list of sub-locations under this one await InvenTreeStockLocation().list(context, filters: {"parent": "$pk"}).then((var locs) {