File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ DeviceManager::DeviceManager()
2929void DeviceManager::append (const LinkConfiguration& linkConf, const QString& deviceName, const QString& detectorName)
3030{
3131 for (int i {0 }; i < _sensors[Connection].size (); i++) {
32- const auto vectorLinkConf = _sensors[Connection][i].value <QSharedPointer<LinkConfiguration>>(). get () ;
33- if (*vectorLinkConf == linkConf) {
32+ const auto vectorLinkConf = _sensors[Connection][i].value <QSharedPointer<LinkConfiguration>>();
33+ if (!vectorLinkConf. isNull () && *vectorLinkConf == linkConf) {
3434 qCDebug (DEVICEMANAGER) << " Connection configuration already exist for:" << _sensors[Name][i] << linkConf
3535 << linkConf.argsAsConst ();
3636 _sensors[Available][i] = true ;
@@ -171,8 +171,8 @@ void DeviceManager::updateAvailableConnections(
171171 for (const auto & link : availableLinkConfigurations) {
172172 const bool sameSerialDevice = std::any_of (
173173 _sensors[Connection].cbegin (), _sensors[Connection].cend (), [&link](const QVariant& variantLink) {
174- const auto sensorLink = variantLink.value <QSharedPointer<LinkConfiguration>>(). get () ;
175- qCDebug (DEVICEMANAGER) << " Device" << sensorLink
174+ const auto sensorLink = variantLink.value <QSharedPointer<LinkConfiguration>>();
175+ qCDebug (DEVICEMANAGER) << " Device" << * sensorLink
176176 << " already already provided by a different connection:" << link;
177177 return link.serialPort () == sensorLink->serialPort () && link != *sensorLink;
178178 });
You can’t perform that action at this time.
0 commit comments