-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Describe the bug
System.NullReferenceException
at MahApps.Metro.Behaviors.WindowsSettingBehavior.<CleanUp>b__7_0() at offset 17
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, System.Object args, System.Int32 numArgs) at offset 55
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object source, System.Delegate callback, System.Object args, System.Int32 numArgs, System.Delegate catchHandler) at offset 2
Steps to reproduce
This sometimes happens on app shutdown. Looking at the code, I suspect Application.Current is null in BeginInvoke:
| Application.Current?.BeginInvoke(() => Application.Current.SessionEnding -= this.CurrentApplicationSessionEnding); |
Environment
MahApps.Metro version: v2.4.3
Windows build number: Win10 2004
Visual Studio: 2019 16.8.0
Target Framework: .Net v4.7.2
Reactions are currently unavailable