From d3a50eec5ef7242cfa9008f8f1fc187194d01b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Thu, 10 Apr 2025 11:56:31 +0200 Subject: [PATCH] EVerest: Fix crash on locahost monitor setup --- everest/integrationplugineverest.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/everest/integrationplugineverest.cpp b/everest/integrationplugineverest.cpp index ace048ff..ea91fe1b 100644 --- a/everest/integrationplugineverest.cpp +++ b/everest/integrationplugineverest.cpp @@ -69,7 +69,7 @@ void IntegrationPluginEverest::startMonitoringAutoThings() ParamList params; params.append(Param(everestThingConnectorParamTypeId, connectorName)); - params.append(Param(everestThingAddressParamTypeId, result.networkDeviceInfo.address().toString())); + params.append(Param(everestThingAddressParamTypeId, result.address.toString())); descriptor.setParams(params); // Let's check if we aleardy have a thing with those params @@ -215,8 +215,15 @@ void IntegrationPluginEverest::setupThing(ThingSetupInfo *info) } if (!everstClient) { + NetworkDeviceMonitor *monitor = hardwareManager()->networkDeviceDiscovery()->registerMonitor(thing); + if (!monitor) { + qCWarning(dcEverest()) << "Incomplete paramerters. Could not register network device monitor with these thing paramaters:" << thing->name() << thing->params(); + info->finish(Thing::ThingErrorMissingParameter); + return; + } + everstClient = new EverestClient(this); - everstClient->setMonitor(hardwareManager()->networkDeviceDiscovery()->registerMonitor(thing)); + everstClient->setMonitor(monitor); m_everstClients.append(everstClient); qCDebug(dcEverest()) << "Created new" << everstClient; everstClient->start();