Small null ref fix in ForceStepDown.

This commit is contained in:
soukoku
2014-06-30 19:40:08 -04:00
parent f2e3196612
commit 830d8a5497
2 changed files with 4 additions and 4 deletions

View File

@@ -14,6 +14,6 @@ namespace NTwain
// keep this same in majors releases // keep this same in majors releases
public const string Release = "2.0.0.0"; public const string Release = "2.0.0.0";
// change this for each nuget release // change this for each nuget release
public const string Build = "2.0.3"; public const string Build = "2.0.4";
} }
} }

View File

@@ -524,15 +524,15 @@ namespace NTwain
_msgLoopHook.Invoke(() => _msgLoopHook.Invoke(() =>
{ {
if (targetState < 7) if (targetState < 7 && CurrentSource != null)
{ {
((ITwainSessionInternal)this).DGControl.PendingXfers.EndXfer(new TWPendingXfers()); ((ITwainSessionInternal)this).DGControl.PendingXfers.EndXfer(new TWPendingXfers());
} }
if (targetState < 6) if (targetState < 6 && CurrentSource != null)
{ {
((ITwainSessionInternal)this).DGControl.PendingXfers.Reset(new TWPendingXfers()); ((ITwainSessionInternal)this).DGControl.PendingXfers.Reset(new TWPendingXfers());
} }
if (targetState < 5) if (targetState < 5 && CurrentSource != null)
{ {
((ITwainSessionInternal)this).DisableSource(); ((ITwainSessionInternal)this).DisableSource();
} }