From dd937c39c92c73c74d7480d44f566efe88ea5108 Mon Sep 17 00:00:00 2001 From: Patrick Grote Date: Fri, 10 May 2024 17:38:59 +0200 Subject: [PATCH] MInor fix --- ArtNetSharp/Communication/AbstractInstance.cs | 6 +++++- ArtNetTests/LoggingTests.cs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ArtNetSharp/Communication/AbstractInstance.cs b/ArtNetSharp/Communication/AbstractInstance.cs index 6cc5ba3..7e5cedd 100644 --- a/ArtNetSharp/Communication/AbstractInstance.cs +++ b/ArtNetSharp/Communication/AbstractInstance.cs @@ -378,7 +378,11 @@ private async Task sendArtPollReply(IPv4Address ownIp, IPv4Address destinationIp try { await Task.Delay((int)(800 * _random.NextDouble())); //Art-Net 4 Protocol Release V1.4 Document Revision 1.4dh 19/7/2023 - 23 - - MACAddress ownMacAddress = ArtNetInstance.GetMacAdress(ownIp); + + if (this.IsDisposing || this.IsDisposed || this.IsDeactivated) + return; + + MACAddress ownMacAddress = ArtNetInstance?.GetMacAdress(ownIp); NodeStatus nodeStatus = getOwnNodeStatus(); NodeReport nodeReport = new NodeReport(ENodeReportCodes.RcPowerOk, "Everything ok.", artPollReplyCounter); Net net = 0; diff --git a/ArtNetTests/LoggingTests.cs b/ArtNetTests/LoggingTests.cs index 3938252..557f74f 100644 --- a/ArtNetTests/LoggingTests.cs +++ b/ArtNetTests/LoggingTests.cs @@ -5,7 +5,7 @@ namespace ArtNetTests.Logging { public class LoggingTests { - [Test] + [Test, Order(-1)] public void TestLogging() { var logger = NullLoggerFactory.Instance.CreateLogger(nameof(LoggingTests));