From d9f4b8b56d035f6cd55565c7b4f21c1a3a77c6ec Mon Sep 17 00:00:00 2001 From: Nate Brown Date: Mon, 31 Aug 2020 16:59:38 -0500 Subject: [PATCH] Default hostmaps to [] --- lib/models/Site.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/models/Site.dart b/lib/models/Site.dart index f981b38..06432a3 100644 --- a/lib/models/Site.dart +++ b/lib/models/Site.dart @@ -206,6 +206,9 @@ class Site { Future> listHostmap() async { try { var ret = await platform.invokeMethod("active.listHostmap", {"id": id}); + if (ret == null) { + return []; + } List f = jsonDecode(ret); List hosts = []; @@ -226,6 +229,9 @@ class Site { Future> listPendingHostmap() async { try { var ret = await platform.invokeMethod("active.listPendingHostmap", {"id": id}); + if (ret == null) { + return []; + } List f = jsonDecode(ret); List hosts = [];