diff --git a/syncthingconnector/syncthingconnection_requests.cpp b/syncthingconnector/syncthingconnection_requests.cpp index 4ff963c..bbfc1e3 100644 --- a/syncthingconnector/syncthingconnection_requests.cpp +++ b/syncthingconnector/syncthingconnection_requests.cpp @@ -712,9 +712,11 @@ void SyncthingConnection::readDevs(const QJsonArray &devs) auto newDevs = std::vector(); newDevs.reserve(static_cast(devs.size())); auto *const thisDevice = addDevInfo(newDevs, m_myId); - thisDevice->id = m_myId; - thisDevice->status = SyncthingDevStatus::ThisDevice; - thisDevice->paused = false; + if (thisDevice) { // m_myId might be empty, then thisDevice will be nullptr + thisDevice->id = m_myId; + thisDevice->status = SyncthingDevStatus::ThisDevice; + thisDevice->paused = false; + } for (const auto &devVal : devs) { const auto devObj = devVal.toObject();