mirror of
https://github.com/greenshot/greenshot
synced 2025-07-05 20:42:14 -07:00
Added some NPE protections for BUG-2991
This commit is contained in:
parent
511034a34b
commit
029d47f479
1 changed files with 5 additions and 0 deletions
|
@ -386,6 +386,7 @@ EndSelection:<<<<<<<4
|
|||
/// <returns>IEnumerable{(MemoryStream,string)}</returns>
|
||||
private static IEnumerable<(MemoryStream stream,string filename)> IterateClipboardContent(IDataObject dataObject)
|
||||
{
|
||||
if (dataObject == null) yield break;
|
||||
var fileDescriptors = AvailableFileDescriptors(dataObject);
|
||||
if (fileDescriptors == null) yield break;
|
||||
|
||||
|
@ -499,6 +500,10 @@ EndSelection:<<<<<<<4
|
|||
public static Image GetImage()
|
||||
{
|
||||
IDataObject clipboardData = GetDataObject();
|
||||
if (clipboardData == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// Return the first image
|
||||
foreach (var clipboardImage in GetImages(clipboardData))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue