From 1980ed15905c27ed8dd182c1b9c6fdc21c513238 Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Fri, 17 Nov 2017 12:14:49 +0200 Subject: [PATCH] do not crash when Plugin.Prepare() failed --- QuickLook/ViewerWindow.Actions.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/QuickLook/ViewerWindow.Actions.cs b/QuickLook/ViewerWindow.Actions.cs index 2016897..10b9575 100644 --- a/QuickLook/ViewerWindow.Actions.cs +++ b/QuickLook/ViewerWindow.Actions.cs @@ -161,7 +161,14 @@ namespace QuickLook ContextObject.ViewerWindow = this; // get window size before showing it - Plugin.Prepare(path, ContextObject); + try + { + Plugin.Prepare(path, ContextObject); + } + catch (Exception e) + { + exceptionHandler(path, ExceptionDispatchInfo.Capture(e)); + } SetOpenWithButtonAndPath();