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

@@ -158,7 +158,14 @@ namespace PepperDash.Essentials.Core
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<Hrxxx0WirelessRemoteControllerJoinMap>(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.");
}
//List<string> ExcludedKeys = new List<string>();
foreach (var feedback in Feedbacks)