Skip to content

Commit

Permalink
prefer raw string messages
Browse files Browse the repository at this point in the history
  • Loading branch information
camnewnham committed Aug 19, 2024
1 parent 4ad1cf8 commit f10fa6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Eto.Wpf/Forms/Controls/WebView2Handler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,13 +642,13 @@ private void Control_NavigationCompleted(object sender, CoreWebView2NavigationCo
private void Control_WebMessageReceived(object sender, CoreWebView2WebMessageReceivedEventArgs e)
{
string content = null;
if (!string.IsNullOrEmpty(e.WebMessageAsJson))
if (e.TryGetWebMessageAsString() is string str && !string.IsNullOrEmpty(str))
{
content = e.WebMessageAsJson;
content = str;
}
else if (e.TryGetWebMessageAsString() is string str && !string.IsNullOrEmpty(str))
else
{
content = str;
content = e.WebMessageAsJson;
}
if (content != null)
{
Expand Down

0 comments on commit f10fa6b

Please sign in to comment.