From 078f35a91d7d57a62eb5a8ee84f3c9d397057e4f Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 15 Aug 2025 09:47:56 -0500 Subject: [PATCH] fix: check EISC for null prior to using --- .../Comm and IR/CommBridge.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CommBridge.cs b/src/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CommBridge.cs index 73e839f8..af9fd543 100644 --- a/src/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CommBridge.cs +++ b/src/essentials-framework/Essentials Core/PepperDashEssentialsBase/Comm and IR/CommBridge.cs @@ -37,19 +37,39 @@ namespace PepperDash.Essentials.Core public void SendBytes(byte[] bytes) { + if (eisc == null) + { + Debug.Console(0, this, "EISC not linked. Call LinkToApi before sending bytes."); + return; + } eisc.Eisc.SetString(joinMap.SendText.JoinNumber, Encoding.ASCII.GetString(bytes, 0, bytes.Length)); } public void SendText(string text) { + if (eisc == null) + { + Debug.Console(0, this, "EISC not linked. Call LinkToApi before sending text."); + return; + } eisc.Eisc.SetString(joinMap.SendText.JoinNumber, text); } public void Connect() { + if (eisc == null) + { + Debug.Console(0, this, "EISC not linked. Call LinkToApi before connecting."); + return; + } eisc.Eisc.SetBool(joinMap.Connect.JoinNumber, true); } public void Disconnect() { + if (eisc == null) + { + Debug.Console(0, this, "EISC not linked. Call LinkToApi before disconnecting."); + return; + } eisc.Eisc.SetBool(joinMap.Connect.JoinNumber, false); }