Remove crash when going to an unassigned DG-ID.

This commit is contained in:
Jonathan Naylor 2020-10-05 10:11:08 +01:00
parent 91ec066418
commit 06c4ff3eac
2 changed files with 9 additions and 4 deletions

View file

@ -415,10 +415,15 @@ int CDGIdGateway::run()
dgIdNetwork[dgId]->link();
}
std::string desc = dgIdNetwork[dgId]->getDesc(dgId);
LogMessage("DG-ID set to %u (%s) via RF", dgId, desc.c_str());
if (dgIdNetwork[dgId] != NULL) {
std::string desc = dgIdNetwork[dgId]->getDesc(dgId);
LogMessage("DG-ID set to %u (%s) via RF", dgId, desc.c_str());
state = DS_NOTLINKED;
} else {
LogMessage("DG-ID set to %u (None) via RF", dgId);
}
currentDGId = dgId;
state = DS_NOTLINKED;
fromRF = true;
}

View file

@ -19,6 +19,6 @@
#if !defined(VERSION_H)
#define VERSION_H
const char* VERSION = "20201004";
const char* VERSION = "20201005";
#endif