add null check to all internal device LinkToApi methods

This allows for backwards compatability with EiscApi bridges.
This commit is contained in:
Andrew Welker
2020-06-19 14:32:26 -06:00
parent d31d4eef30
commit 09d47d3e5d
23 changed files with 189 additions and 39 deletions

View File

@@ -209,7 +209,14 @@ namespace PepperDash.Essentials.Core.Monitoring
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<SystemMonitorJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(2, this, "Linking API starting at join: {0}", joinStart);