Skip to content

Commit

Permalink
WPF - Fix WpfIMEKeyboardHandler crash when browser is not initalized. (
Browse files Browse the repository at this point in the history
…#3690)

GetBrowserHost will throw exception when browser is not initalized.
  • Loading branch information
kkwpsv authored and amaitland committed Jul 22, 2021
1 parent 734cb8f commit bcf338f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private IntPtr SourceHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, re
{
handled = false;

if (!isActive || !isSetup || owner == null || owner.IsDisposed || owner.GetBrowserHost() == null)
if (!isActive || !isSetup || owner == null || owner.IsDisposed || !owner.IsBrowserInitialized || owner.GetBrowserHost() == null)
{
return IntPtr.Zero;
}
Expand Down

0 comments on commit bcf338f

Please sign in to comment.