From 1d9289086bbb25b67d36c701d2438d8095e455e9 Mon Sep 17 00:00:00 2001 From: dahall Date: Thu, 4 Feb 2021 14:22:56 -0700 Subject: [PATCH] Fixed bug in ShellItemImages throwing unnecessary error if unable to generate thumbnail --- Windows.Shell/ShellObjects/ShellItemImages.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Windows.Shell/ShellObjects/ShellItemImages.cs b/Windows.Shell/ShellObjects/ShellItemImages.cs index 69d8b001..56e67b3c 100644 --- a/Windows.Shell/ShellObjects/ShellItemImages.cs +++ b/Windows.Shell/ShellObjects/ShellItemImages.cs @@ -40,8 +40,8 @@ namespace Vanara.Windows.Shell hr = fctry.GetImage(size, (SIIGBF)flags, out hbmp); if (hr == 0x8004B200 && flags.IsFlagSet(ShellItemGetImageOptions.ThumbnailOnly)) throw new InvalidOperationException("Thumbnails are not supported by this item."); - hr.ThrowIfFailed(); - return hbmp; + if (hr.Succeeded) + return hbmp; } //hr = LoadImageFromThumbnailProvider(shellItem.IShellItem, ref sz, out hbmp);