Skip to content

Commit 664009c

Browse files
committed
Fix deskband logging regression
1 parent f6219c6 commit 664009c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

EverythingToolbar/Helpers/ToolbarLogger.cs

+8-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@ private static void InitializeExceptionLoggers(ILogger logger)
4747
{
4848
logger.Error((Exception)args.ExceptionObject, "Unhandled exception");
4949
};
50-
Application.Current.DispatcherUnhandledException += (sender, args) =>
50+
51+
if (Application.Current != null)
5152
{
52-
logger.Error(args.Exception, "Unhandled exception on UI thread");
53-
};
53+
// Not applicable for deskband
54+
Application.Current.DispatcherUnhandledException += (sender, args) =>
55+
{
56+
logger.Error(args.Exception, "Unhandled exception on UI thread");
57+
};
58+
}
5459
}
5560

5661
private static void ConfigureLogger()

0 commit comments

Comments
 (0)