Skip to content

Commit 34c800e

Browse files
committed
Fix possible crash as reported in #4481
1 parent f0a68a3 commit 34c800e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main/mainworker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,8 @@ void MainWorker::CheckAndPushRxMessage(const CDomoticzHardwareBase *pHardware, c
20152015
rxMessage.Name = defaultName;
20162016
}
20172017
rxMessage.BatteryLevel = BatteryLevel;
2018-
rxMessage.UserName = userName;
2018+
if (userName != nullptr)
2019+
rxMessage.UserName = userName;
20192020
rxMessage.rxMessageIdx = m_rxMessageIdx++;
20202021
rxMessage.hardwareId = pHardware->m_HwdID;
20212022
// defensive copy of the command

0 commit comments

Comments
 (0)