Adds null check for _worker before checking thread state

This commit is contained in:
Neil Dorin
2021-02-26 14:16:53 -07:00
parent c5aef18943
commit 00589488ac

View File

@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.Core.Utilities
/// </summary> /// </summary>
public void StartSequence() public void StartSequence()
{ {
if (_worker.ThreadState == Thread.eThreadStates.ThreadRunning) if (_worker !=null && _worker.ThreadState == Thread.eThreadStates.ThreadRunning)
{ {
Debug.Console(1, this, "Thread already running. Cannot Start Sequence"); Debug.Console(1, this, "Thread already running. Cannot Start Sequence");
return; return;