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

@@ -230,7 +230,14 @@ namespace PepperDash.Essentials.DM
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<HdMdxxxCEControllerJoinMap>(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, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));