mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-14 03:29:07 +00:00
Show office exception instead of crash
This commit is contained in:
@@ -134,11 +134,22 @@ public class Plugin : IViewer
|
||||
}
|
||||
}
|
||||
|
||||
_panel = new PreviewPanel();
|
||||
context.ViewerContent = _panel;
|
||||
context.Title = Path.GetFileName(path);
|
||||
|
||||
_panel.PreviewFile(path, context);
|
||||
try
|
||||
{
|
||||
_panel = new PreviewPanel();
|
||||
context.ViewerContent = _panel;
|
||||
context.Title = Path.GetFileName(path);
|
||||
_panel.PreviewFile(path, context);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
context.ViewerContent = new Label()
|
||||
{
|
||||
Content = e.ToString(),
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
};
|
||||
}
|
||||
|
||||
context.IsBusy = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user