From 9d0e326f5e57c084b3b0e05701fa7dcc41be860e Mon Sep 17 00:00:00 2001 From: Beatriz Rizental Date: Wed, 29 Nov 2023 15:04:41 +0100 Subject: [PATCH] Abort controller activation when there is no current device (#8694) --- src/controller.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/controller.cpp b/src/controller.cpp index 4027b4724d..74f1ec8550 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -350,6 +350,11 @@ void Controller::activateInternal(DNSPortPolicy dnsPort, MozillaVPN* vpn = MozillaVPN::instance(); const Device* device = vpn->deviceModel()->currentDevice(vpn->keys()); + if (!device) { + logger.warning() << "No current device. Aborting activation."; + m_nextStep = Disconnect; + return; + } SettingsHolder* settingsHolder = SettingsHolder::instance(); // Prepare the exit server's connection data.