Skip to content

Commit 76057d0

Browse files
Update so the check happens within the anon method.
1 parent 87fb4eb commit 76057d0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

MaterialDesignThemes.Wpf/DialogHost.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,9 @@ private static void IsOpenPropertyChangedCallback(DependencyObject dependencyObj
265265
// Don't attempt to Invoke if _restoreFocusDialogClose hasn't been assigned yet. Can occur
266266
// if the MainWindow has started up minimized. Even when Show() has been called, this doesn't
267267
// seem to have been set.
268-
if (dialogHost._restoreFocusDialogClose != null)
269-
{
270-
dialogHost.Dispatcher.InvokeAsync(() => dialogHost._restoreFocusDialogClose.Focus(), DispatcherPriority.Input);
271-
}
268+
269+
dialogHost.Dispatcher.InvokeAsync(() => dialogHost._restoreFocusDialogClose?.Focus(), DispatcherPriority.Input);
270+
272271
return;
273272
}
274273

0 commit comments

Comments
 (0)