Skip to content

Commit ecdb948

Browse files
committed
2.4.1.7 - Just return nothing if there's an exception.
1 parent c4c0431 commit ecdb948

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

ScreenCapture.cs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -693,16 +693,9 @@ public Bitmap GetScreenBitmap(int source, int component, int captureMethod, int
693693

694694
return null;
695695
}
696-
catch (Exception ex)
696+
catch (Exception)
697697
{
698-
// Don't log an error if Windows is locked at the time a screenshot was taken.
699-
if (!ex.Message.Equals("The handle is invalid"))
700-
{
701-
_log.WriteExceptionMessage("ScreenCapture::GetScreenBitmap", ex);
702-
703-
CaptureError = true;
704-
}
705-
698+
// Just return nothing if there's an exception.
706699
return null;
707700
}
708701
}
@@ -775,16 +768,9 @@ public Bitmap GetActiveWindowBitmap(int resolutionRatio, bool mouse)
775768

776769
return null;
777770
}
778-
catch (Exception ex)
771+
catch (Exception)
779772
{
780-
// Don't log an error if Windows is locked at the time a screenshot was taken.
781-
if (!ex.Message.Equals("The handle is invalid"))
782-
{
783-
_log.WriteExceptionMessage("ScreenCapture::GetActiveWindowBitmap", ex);
784-
785-
CaptureError = true;
786-
}
787-
773+
// Just return nothing if there's an exception.
788774
return null;
789775
}
790776
}

0 commit comments

Comments
 (0)