mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-06 00:05:05 +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);
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user