From 8a0fdcf0eb5b6c53ef45bcc021f6dbd38a19a183 Mon Sep 17 00:00:00 2001 From: Nate Brown Date: Fri, 7 Aug 2020 16:11:26 -0500 Subject: [PATCH] Safer defaults in an error event for tunnels, fix the details screen when starting --- lib/screens/SiteDetailScreen.dart | 4 ++-- lib/screens/SiteTunnelsScreen.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/screens/SiteDetailScreen.dart b/lib/screens/SiteDetailScreen.dart index 160bfb1..58b2c38 100644 --- a/lib/screens/SiteDetailScreen.dart +++ b/lib/screens/SiteDetailScreen.dart @@ -53,10 +53,10 @@ class _SiteDetailScreenState extends State { if (lastState != site.connected) { //TODO: connected is set before the nebula object exists leading to a crash race, waiting for "Connected" status is a gross hack but keeps it alive if (site.status == 'Connected') { - lastState = site.connected; + lastState = true; _listHostmap(); } else { - lastState = site.connected; + lastState = false; activeHosts = null; pendingHosts = null; } diff --git a/lib/screens/SiteTunnelsScreen.dart b/lib/screens/SiteTunnelsScreen.dart index d863306..b3c3b6e 100644 --- a/lib/screens/SiteTunnelsScreen.dart +++ b/lib/screens/SiteTunnelsScreen.dart @@ -30,7 +30,7 @@ class _SiteTunnelsScreenState extends State { @override void initState() { site = widget.site; - tunnels = widget.tunnels; + tunnels = widget.tunnels ?? []; _sortTunnels(); super.initState(); }