Skip to content

Commit 34165eb

Browse files
committed
Fix what i broke in ArtAddressCommand
1 parent c9ae436 commit 34165eb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ArtNetSharp/Misc/ObjectTypes/ArtAddressCommand.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ public ArtAddressCommand(in EArtAddressCommand command, in byte? x = null)
2020

2121
if (x.HasValue)
2222
{
23-
if (command == EArtAddressCommand.SetBackgroundQueuePolicy)
24-
if (x.Value >= 4)
25-
throw new ArgumentOutOfRangeException($"{nameof(x)} has to be between 0 and 3");
26-
else
27-
if (x.Value >= 15)
28-
throw new ArgumentOutOfRangeException($"{nameof(x)} has to be between 0 and 15");
23+
if (command != EArtAddressCommand.SetBackgroundQueuePolicy && x.Value >= 4)
24+
throw new ArgumentOutOfRangeException($"{nameof(x)} has to be between 0 and 3");
25+
else if (command == EArtAddressCommand.SetBackgroundQueuePolicy && x.Value >= 15)
26+
throw new ArgumentOutOfRangeException($"{nameof(x)} has to be between 0 and 15");
2927
}
3028

3129
Command = command;

0 commit comments

Comments
 (0)