diff --git a/NTwain/Properties/VersionInfo.cs b/NTwain/Properties/VersionInfo.cs index 2f2ce7b..7be4146 100644 --- a/NTwain/Properties/VersionInfo.cs +++ b/NTwain/Properties/VersionInfo.cs @@ -14,6 +14,6 @@ namespace NTwain // keep this same in majors releases public const string Release = "2.0.0.0"; // change this for each nuget release - public const string Build = "2.0.3"; + public const string Build = "2.0.4"; } } \ No newline at end of file diff --git a/NTwain/TwainSession.cs b/NTwain/TwainSession.cs index a1c5a60..d34ebd8 100644 --- a/NTwain/TwainSession.cs +++ b/NTwain/TwainSession.cs @@ -524,15 +524,15 @@ namespace NTwain _msgLoopHook.Invoke(() => { - if (targetState < 7) + if (targetState < 7 && CurrentSource != null) { ((ITwainSessionInternal)this).DGControl.PendingXfers.EndXfer(new TWPendingXfers()); } - if (targetState < 6) + if (targetState < 6 && CurrentSource != null) { ((ITwainSessionInternal)this).DGControl.PendingXfers.Reset(new TWPendingXfers()); } - if (targetState < 5) + if (targetState < 5 && CurrentSource != null) { ((ITwainSessionInternal)this).DisableSource(); }