From 03733cfa0f5fb6980f2bbdd5e353a1edbbeee728 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Wed, 20 Nov 2024 09:19:24 +0530 Subject: [PATCH] fix for tests --- lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index 2fe3adc..1334a74 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -79,9 +79,13 @@ class HostScanBloc extends Bloc { } if (gatewayIp == null) { emit(const HostScanState.error()); - return; + return Future.error('Can not get wifi details'); } subnet = gatewayIp!.substring(0, gatewayIp!.lastIndexOf('.')); + if (subnet == null) { + emit(const HostScanState.error()); + return Future.error('Can not get wifi details'); + } if (appSettings.runScanOnStartup) { add(const HostScanEvent.loadScan()); } else {