From e620cfa515b9011bb5aca6e1cbb0f776b43c97b7 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 2 Apr 2022 11:29:45 +1100 Subject: [PATCH] Fix bug which prevented creation of stock item at top level location --- lib/widget/location_display.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widget/location_display.dart b/lib/widget/location_display.dart index b99c8077..75554e1a 100644 --- a/lib/widget/location_display.dart +++ b/lib/widget/location_display.dart @@ -170,7 +170,7 @@ class _LocationDisplayState extends RefreshableState { int pk = location?.pk ?? -1; - if (pk <= 0) { + if (location != null && pk <= 0) { return; } @@ -178,7 +178,7 @@ class _LocationDisplayState extends RefreshableState { context, L10().stockItemCreate, data: { - "location": pk, + "location": location != null ? pk : null, }, onSuccess: (result) async {