mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
fix: add null check for room before adding to DeviceManager
This commit is contained in:
parent
3fad74e595
commit
e314f58035
1 changed files with 10 additions and 1 deletions
|
|
@ -471,7 +471,16 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
var room = Core.DeviceFactory.GetDevice(roomConfig);
|
var room = Core.DeviceFactory.GetDevice(roomConfig);
|
||||||
|
|
||||||
DeviceManager.AddDevice(room);
|
if(room == null)
|
||||||
|
{
|
||||||
|
Debug.LogMessage(LogEventLevel.Information, "ERROR: Cannot load unknown room type '{roomType:l}', key '{roomKey:l}'.", roomConfig.Type, roomConfig.Key);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DeviceManager.AddDevice(room);
|
||||||
|
}
|
||||||
|
|
||||||
if (room is ICustomMobileControl)
|
if (room is ICustomMobileControl)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue