mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
adds try/catch for Null Reference Exceptions
This commit is contained in:
@@ -56,7 +56,16 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
|
||||||
|
|
||||||
var advDev = device as IBridgeAdvanced;
|
var advDev = device as IBridgeAdvanced;
|
||||||
advDev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, null);
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
advDev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, null);
|
||||||
|
}
|
||||||
|
catch (NullReferenceException)
|
||||||
|
{
|
||||||
|
Debug.ConsoleWithLog(0, this,
|
||||||
|
"Please update the bridge config to use EiscBridgeAdvanced with this device: {0}", device.Key);
|
||||||
|
}
|
||||||
//if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
|
//if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
|
||||||
//{
|
//{
|
||||||
// var bridge = device as IBridge;
|
// var bridge = device as IBridge;
|
||||||
|
|||||||
@@ -360,7 +360,8 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Load Plugin not found. {0} is not a plugin assembly. Exception: {1}", loadedAssembly.Name, e);
|
Debug.Console(2, "Load Plugin not found. {0}.{2} is not a plugin factory. Exception: {1}",
|
||||||
|
loadedAssembly.Name, e, type.Name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user