From 49d5cd36df9bb788e1899cfbe61dbd60fa0b17c1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 23 Sep 2025 12:24:44 +0800 Subject: [PATCH] Catch exception --- Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs b/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs index c942488c4..9f38a64df 100644 --- a/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs +++ b/Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs @@ -141,7 +141,15 @@ namespace Flow.Launcher.Infrastructure.Image } catch { - hBitmap = GetHBitmap(Path.GetFullPath(fileName), width, height, options); + try + { + hBitmap = GetHBitmap(Path.GetFullPath(fileName), width, height, options); + } + catch (System.Exception ex) + { + // Handle other exceptions + throw new InvalidOperationException("Failed to get thumbnail", ex); + } } return hBitmap;