1
0
forked from BRT/arc

Add validation to ensure device.name is not empty before registering a new device in API sync logic.

This commit is contained in:
trnsmkot 2026-04-09 22:32:58 +07:00
parent 7e5317fbc8
commit 1074e9932b

View File

@ -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()) {