Fix crash in `syncthingctl cat` after f5795d45c2
This commit is contained in:
parent
68858fe702
commit
978636b5aa
|
@ -712,9 +712,11 @@ void SyncthingConnection::readDevs(const QJsonArray &devs)
|
||||||
auto newDevs = std::vector<SyncthingDev>();
|
auto newDevs = std::vector<SyncthingDev>();
|
||||||
newDevs.reserve(static_cast<std::size_t>(devs.size()));
|
newDevs.reserve(static_cast<std::size_t>(devs.size()));
|
||||||
auto *const thisDevice = addDevInfo(newDevs, m_myId);
|
auto *const thisDevice = addDevInfo(newDevs, m_myId);
|
||||||
thisDevice->id = m_myId;
|
if (thisDevice) { // m_myId might be empty, then thisDevice will be nullptr
|
||||||
thisDevice->status = SyncthingDevStatus::ThisDevice;
|
thisDevice->id = m_myId;
|
||||||
thisDevice->paused = false;
|
thisDevice->status = SyncthingDevStatus::ThisDevice;
|
||||||
|
thisDevice->paused = false;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &devVal : devs) {
|
for (const auto &devVal : devs) {
|
||||||
const auto devObj = devVal.toObject();
|
const auto devObj = devVal.toObject();
|
||||||
|
|
Loading…
Reference in New Issue