mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
refactor: add error handling for cases where type isn't found
This commit is contained in:
@@ -219,6 +219,11 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
var panel = GetPanelForType(dc.Type, comm.IpIdInt, props.ProjectName);
|
var panel = GetPanelForType(dc.Type, comm.IpIdInt, props.ProjectName);
|
||||||
|
|
||||||
|
if (panel == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "Unable to create Touchpanel for type {0}. Touchpanel Controller WILL NOT function correctly", dc.Type);
|
||||||
|
}
|
||||||
|
|
||||||
Debug.Console(1, "Factory Attempting to create new EssentialsTouchpanelController");
|
Debug.Console(1, "Factory Attempting to create new EssentialsTouchpanelController");
|
||||||
|
|
||||||
var panelController = new EssentialsTouchpanelController(dc.Key, dc.Name, panel, props);
|
var panelController = new EssentialsTouchpanelController(dc.Key, dc.Name, panel, props);
|
||||||
|
|||||||
@@ -29,7 +29,14 @@ namespace PepperDash.Essentials.Core.UI
|
|||||||
/// <param name="id">IP-ID to use for touch panel</param>
|
/// <param name="id">IP-ID to use for touch panel</param>
|
||||||
protected TouchpanelBase(string key, string name, BasicTriListWithSmartObject panel, CrestronTouchpanelPropertiesConfig config)
|
protected TouchpanelBase(string key, string name, BasicTriListWithSmartObject panel, CrestronTouchpanelPropertiesConfig config)
|
||||||
:base(key, name)
|
:base(key, name)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (Panel == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Panel is not valid. Touchpanel class WILL NOT work correctly");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Panel = panel;
|
Panel = panel;
|
||||||
|
|
||||||
Panel.SigChange += Panel_SigChange;
|
Panel.SigChange += Panel_SigChange;
|
||||||
|
|||||||
Reference in New Issue
Block a user