From 59ca9ff47508fa157a4bb9d1f48623a6a6f782fc Mon Sep 17 00:00:00 2001 From: Hiddify Date: Thu, 22 Feb 2024 10:04:21 +0100 Subject: [PATCH] fix: exception when there is no active profile --- lib/features/connection/notifier/connection_notifier.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/features/connection/notifier/connection_notifier.dart b/lib/features/connection/notifier/connection_notifier.dart index 9863a6aa..ddcccd91 100644 --- a/lib/features/connection/notifier/connection_notifier.dart +++ b/lib/features/connection/notifier/connection_notifier.dart @@ -119,9 +119,13 @@ class ConnectionNotifier extends _$ConnectionNotifier with AppLogger { Future _connect() async { final activeProfile = await ref.read(activeProfileProvider.future); + if (activeProfile == null) { + loggy.info("no active profile, not connecting"); + return; + } await _connectionRepo .connect( - activeProfile!.id, + activeProfile.id, activeProfile.name, ref.read(disableMemoryLimitProvider), )