Bug 57546 - UWP - Unhandled exception when leaving page before WebView contents load
Summary: UWP - Unhandled exception when leaving page before WebView contents load
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.4
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-06-16 08:29 UTC by Milan Laslop
Modified: 2017-10-24 12:13 UTC (History)
2 users (show)

Tags: ac, uwp, webview, navigation
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 57546 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Milan Laslop 2017-06-16 08:29:52 UTC
*STEPS TO REPRODUCE*
- git clone https://github.com/milan11/xamarin_forms_webview_test.git
- run App6.UWP on emulator
- press "Go to browser"
- immediately (before the next page loads), press back
- the app crashes with unhandled exception:
{"Object reference not set to an instance of an object."}
Stack:
   at Xamarin.Forms.Platform.UWP.WebViewRenderer.<>c__DisplayClass4_0.<<LoadHtml>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()

- if it is too slow / to fast, change count in BrowserPage.BrowserPage

Tested with Xamarin.Forms 2.3.4.224.
Comment 1 Jimmy [MSFT] 2017-06-20 19:10:43 UTC
I was able to reproduce the issue using the project linked to in the description. The crash happens on a mobile emulator/device. It also may not occur immediately after hitting the back button but after around one second. 

This appears to be a race condition so I will confirm the report and we will investigate further.

> Object reference not set to an instance of an object.
> at Xamarin.Forms.Platform.UWP.WebViewRenderer.<>c__DisplayClass4_0.<<LoadHtml>b__0>d.MoveNext()
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
> at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()


### Version Tests
2.3.5-pre3  BAD
2.3.4.247   BAD
Comment 2 Milan Laslop 2017-10-24 12:13:19 UTC
Is there any progress with this?
Is this a low-priority unimportant problem which will not be resolved soon (or never)? In that case we will use some workaround.