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

@@ -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();
}