fix(device): fix IpcRenderer empty data messages (#503)
* fix(device): fix IpcRenderer empty data messages If IpcRenderer send null / undefined data as argument then IpcMain parse it as empty array and not a NULL object * fix else line break
This commit is contained in:
committed by
László Monda
parent
95d1d7f8b5
commit
58b1b9b1dc
@@ -144,7 +144,7 @@ export class DeviceService {
|
||||
try {
|
||||
this.stopPollTimer();
|
||||
|
||||
if (data) {
|
||||
if (data && data.length > 0) {
|
||||
firmwarePathData = await saveTmpFirmware(data);
|
||||
await this.operations.updateRightFirmware(firmwarePathData.rightFirmwarePath);
|
||||
await this.operations.updateLeftModule(firmwarePathData.leftFirmwarePath);
|
||||
@@ -162,7 +162,9 @@ export class DeviceService {
|
||||
response.error = err;
|
||||
}
|
||||
|
||||
await emptyDir(firmwarePathData.tmpDirectory.name);
|
||||
if (firmwarePathData) {
|
||||
await emptyDir(firmwarePathData.tmpDirectory.name);
|
||||
}
|
||||
|
||||
await snooze(500);
|
||||
event.sender.send(IpcEvents.device.updateFirmwareReply, response);
|
||||
|
||||
Reference in New Issue
Block a user