mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-13 20:47:04 +00:00
fix: add null check for room before adding to DevManager
This commit is contained in:
parent
65a0743dac
commit
041059210c
1 changed files with 4 additions and 2 deletions
|
|
@ -483,11 +483,13 @@ namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
var room = Core.DeviceFactory.GetDevice(roomConfig);
|
var room = Core.DeviceFactory.GetDevice(roomConfig);
|
||||||
|
|
||||||
DeviceManager.AddDevice(room);
|
if(room == null)
|
||||||
if (room is ICustomMobileControl)
|
|
||||||
{
|
{
|
||||||
|
Debug.LogWarning("ERROR: Cannot load unknown room type '{roomType:l}', key '{roomKey:l}'.", roomConfig.Type, roomConfig.Key);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeviceManager.AddDevice(room);
|
||||||
} catch (Exception ex)
|
} catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Exception loading room {roomKey}:{roomType}", null, roomConfig.Key, roomConfig.Type);
|
Debug.LogMessage(ex, "Exception loading room {roomKey}:{roomType}", null, roomConfig.Key, roomConfig.Type);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue