mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
fix: add null check for room before adding to DeviceManager
This commit is contained in:
@@ -471,7 +471,16 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
var room = Core.DeviceFactory.GetDevice(roomConfig);
|
var room = Core.DeviceFactory.GetDevice(roomConfig);
|
||||||
|
|
||||||
|
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);
|
DeviceManager.AddDevice(room);
|
||||||
|
}
|
||||||
|
|
||||||
if (room is ICustomMobileControl)
|
if (room is ICustomMobileControl)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user