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 = [];