alien64 / zirco-browser

Automatically exported from code.google.com/p/zirco-browser
Other
0 stars 0 forks source link

JellyBean: Crashing when entering URL into address bar #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reproduction:
1. HEAD code (and probably earlier); JellyBean/4.1 (emulator okay).
2. Enter URL into Zirco address bar. Hit arrow button or "Done" on keyboard.
3. Null pointer exception, CustomWebViewClient.java:145

The problem is this if statement:

  } else if (view.getHitTestResult().getType() == HitTestResult.EMAIL_TYPE) {

In Jelly Bean, unlike earlier Android versions, apparently, getHitTestResult() 
returns null if it wasn't a touch action that triggered the new URL load. So 
the above test fails when an address is entered into the bar.

I believe that the fix will be to add a null check, like so:

  } else if (view.getHitTestResult() != null && view.getHitTestResult().getType() == HitTestResult.EMAIL_TYPE) {

Original issue reported on code.google.com by a.pritch...@psiphon.ca on 18 Jul 2012 at 6:14

GoogleCodeExporter commented 9 years ago
Fixed in r465. Thanks for pointing this out.

Original comment by J.Devauc...@gmail.com on 20 Jul 2012 at 1:00