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 {