Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Android 6, the default homepage is null instead of "about:blank". Clicking the bookmark toggle icon causes app to crash. #1

Closed
sagorahmed opened this issue May 21, 2019 · 6 comments

Comments

@sagorahmed
Copy link

Expected behavior

I expected that the app would warn or block me when I tried to bookmark a blank page.

Actual behavior

The app crashed when I bookmarked a blank page. After that this crash occurring every time whenever I am trying to open the app.

How to reproduce

Here is every possible detail to reproduce the bug.

  1. Open the app
  2. Click on the bookmark button at the top of your screen.
  3. Notice the crash. After that, whenever you will try to open this app, you have to face the crash. (You can make it workable again after deleting the app data)
  • App version: 04.07.01
  • Operating system: Android 6.0.1

Recording Of The Bug

bug

LogCat

05-21 14:35:14.108  8984  8984 E AndroidRuntime: FATAL EXCEPTION: main

05-21 14:35:14.108  8984  8984 E AndroidRuntime: Process: com.github.warren_bank.webcast, PID: 8984

05-21 14:35:14.108  8984  8984 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.github.warren_bank.webcast.webview.BrowserActivity$DrawerListItem.equal(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.github.warren_bank.webcast.webview.BrowserActivity$DrawerListItem.find(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.github.warren_bank.webcast.webview.BrowserActivity$DrawerListItem.contains(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.github.warren_bank.webcast.webview.BrowserActivity.onCreateOptionsMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.app.Activity.onCreatePanelMenu(Activity.java:3142)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.f.a.e.onCreatePanelMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.view.i.onCreatePanelMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.app.g$d.onCreatePanelMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.view.i.onCreatePanelMenu(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.app.j.i(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at androidx.appcompat.app.j$1.run(Unknown Source)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:739)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:148)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7325)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

05-21 14:35:14.108  8984  8984 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
@warren-bank
Copy link
Owner

Hi. Thanks so much for your excellent bug report.

I'll definitely have a fix posted by tomorrow. Unfortunately, I can't reproduce it on my phones.. they're all running older versions of Android.. so I'll need to fire up an emulator.

If I was to guess.. it's probably that newer versions of WebView treat "about:blank" differently; it looks like yours is returning null when asked for the current URL.

In any case.. adding a line of validation to catch a non-sensical URL value would be easy.. and prevent this from happening.

@sagorahmed
Copy link
Author

Thank you so much for your fast reply on the issues. Good to see how much you take care of your project.

@warren-bank
Copy link
Owner

I just pushed a very minor update

..I haven't reproduced this crash (yet), but I'm guessing this should prevent it from happening.

@sagorahmed
Copy link
Author

Nothing changed. It is behaving weirdly like before.

@warren-bank
Copy link
Owner

I amended the previous commit.. this new update fixes the error.

Thanks again for letting me know that there was a problem; I really do appreciate it. :)

@warren-bank warren-bank changed the title The app crashed after I bookmarked a blank page. On Android 6, the default homepage is null instead of "about:blank". Clicking the bookmark toggle icon causes app to crash. May 22, 2019
@sagorahmed
Copy link
Author

Yes, this issue is not occurring anymore. Thanks for fixing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants