Skip to content

Commit

Permalink
Merge pull request #50 from mjwsteenbergen/patch-1
Browse files Browse the repository at this point in the history
Fix correct disposing of Device with a single question mark
  • Loading branch information
roddone authored Feb 8, 2021
2 parents 753d677 + f901bd0 commit 62a40d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions YeelightAPI/Device.IDeviceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void Disconnect()
_tcpClient = null;
try
{
_watchCancellationTokenSource.Cancel();
_watchCancellationTokenSource?.Cancel();
}
catch (ObjectDisposedException) { }
}
Expand Down Expand Up @@ -452,4 +452,4 @@ public async Task<bool> TurnOn(int? smooth = null, PowerOnMode mode = PowerOnMod

#endregion Public Methods
}
}
}

0 comments on commit 62a40d1

Please sign in to comment.