fix: add null check for room before adding to DeviceManager

This commit is contained in:
jtalborough
2025-02-27 11:17:07 -05:00
parent 3fad74e595
commit e314f58035

View File

@@ -471,7 +471,16 @@ namespace PepperDash.Essentials
{
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)
{
continue;