Add validation to ensure device.name is not empty before registering a new device in API sync logic.
This commit is contained in:
parent
87d74e7747
commit
0c1d2675b3
@ -382,7 +382,7 @@ void DeviceScreener::start() {
|
||||
|
||||
// Синхронизация с API
|
||||
DeviceInfo saved = DeviceDAO::getDeviceById(device.id);
|
||||
if (saved.apiId.isEmpty()) {
|
||||
if (saved.apiId.isEmpty() && !device.name.isEmpty()) {
|
||||
// Устройство ещё не зарегистрировано — создаём
|
||||
const QString apiId = createDeviceOnApi(device);
|
||||
if (!apiId.isEmpty()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user