diff --git a/BinaryObjectScanner/BinaryObjectScanner.csproj b/BinaryObjectScanner/BinaryObjectScanner.csproj
index 28ec8db3..847b3cf3 100644
--- a/BinaryObjectScanner/BinaryObjectScanner.csproj
+++ b/BinaryObjectScanner/BinaryObjectScanner.csproj
@@ -10,8 +10,9 @@
latest
enable
true
-
+ true
3.1.6
+ CS0162;CS0612
Matt Nadareski
diff --git a/BinaryObjectScanner/Progress.cs b/BinaryObjectScanner/Progress.cs
index 80811e68..dd1e8a1b 100644
--- a/BinaryObjectScanner/Progress.cs
+++ b/BinaryObjectScanner/Progress.cs
@@ -23,7 +23,7 @@ namespace System
public class Progress : IProgress where T : EventArgs
{
/// The synchronization context captured upon construction. This will never be null.
- private readonly SynchronizationContext _synchronizationContext;
+ private readonly SynchronizationContext? _synchronizationContext;
/// The handler specified to the constructor. This may be null.
private readonly Action? _handler;
/// A cached delegate used to post invocation to the synchronization context.
@@ -73,7 +73,7 @@ namespace System
{
// Post the processing to the sync context.
// (If T is a value type, it will get boxed here.)
- _synchronizationContext.Post(_invokeHandlers, value);
+ _synchronizationContext?.Post(_invokeHandlers, value);
}
}