Fix a crash when removing a thing without plugin
This commit is contained in:
parent
045a3606a2
commit
6b0697182d
@ -742,7 +742,12 @@ Thing::ThingError ThingManagerImplementation::removeConfiguredThing(const ThingI
|
|||||||
if (!thing) {
|
if (!thing) {
|
||||||
return Thing::ThingErrorThingNotFound;
|
return Thing::ThingErrorThingNotFound;
|
||||||
}
|
}
|
||||||
m_integrationPlugins.value(thing->pluginId())->thingRemoved(thing);
|
IntegrationPlugin *plugin = m_integrationPlugins.value(thing->pluginId());
|
||||||
|
if (!plugin) {
|
||||||
|
qCWarning(dcThingManager()).nospace() << "Plugin not loaded for thing " << thing->name() << ". Not calling thingRemoved on plugin.";
|
||||||
|
} else {
|
||||||
|
plugin->thingRemoved(thing);
|
||||||
|
}
|
||||||
|
|
||||||
thing->deleteLater();
|
thing->deleteLater();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user