App crashes because of issue in OSM library
Project Information
- Repository: https://github.com/openhab/openhab-android
- Project Name: openhab-android
- My Github Account: https://github.com/friendsmobile
- Download the application: https://play.google.com/store/apps/details?id=org.openhab.habdroid
- My submitted issue here: https://github.com/openhab/openhab-android/issues/1443
Expected behavior
When I turn on toggle switch, the application should not be crashing, but when I turn off the button, it gets off
Actual behavior
The application crashes when I turn toggle switch on or off
How to reproduce
Download the application
open the application
click on Widget Overview
Turn toggle switch on and off
Note the Error
Browser/App version: version 2.7.11 beta
Operating system: 6.0
Recording Of The Bug
Logcat
D/AndroidRuntime(28653): Shutting down VM
E/AndroidRuntime(28653): FATAL EXCEPTION: main
E/AndroidRuntime(28653): Process: org.openhab.habdroid.beta, PID: 28653
E/AndroidRuntime(28653): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context org.osmdroid.views.MapView.getContext()' on a null object reference
E/AndroidRuntime(28653): at org.osmdroid.views.MapViewRepository.getDefaultMarkerIcon(MapViewRepository.java:74)
E/AndroidRuntime(28653): at org.osmdroid.views.overlay.Marker.setDefaultIcon(Marker.java:139)
E/AndroidRuntime(28653): at org.osmdroid.views.overlay.Marker.(Marker.java:114)
E/AndroidRuntime(28653): at org.osmdroid.views.overlay.Marker.(Marker.java:92)
E/AndroidRuntime(28653): at org.openhab.habdroid.ui.MapViewHelperKt.setMarker(MapViewHelper.kt:244)
E/AndroidRuntime(28653): at org.openhab.habdroid.ui.MapViewHelperKt.applyPositionAndLabel(MapViewHelper.kt:223)
E/AndroidRuntime(28653): at org.openhab.habdroid.ui.MapViewHelper$OsmViewHolder$bind$1.run(MapViewHelper.kt:101)
E/AndroidRuntime(28653): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(28653): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(28653): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(28653): at android.app.ActivityThread.main(ActivityThread.java:5910)
E/AndroidRuntime(28653): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(28653): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(28653): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
E/AndroidRuntime(28653): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Hi @friendsmobile, thanks for making this contribution
I can see that the contribution has been acknowledged by the PO. And I see he fixed it in this commit - https://github.com/mueller-ma/openhab.android/commit/8a7d25761df460fabcbd4a68a4394173693822b2. I love that you included a logcat but these days we expect a bit of analysis to complement the stack trace. Some explanations on what could have possibly gone wrong
Still a good post. We look forward to more of your reports
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Chat with us on Discord.
[utopian-moderator]
Thank you for your review, @fego! Keep up the good work!
Congratulations @friendsmobile! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Hi @friendsmobile!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server
Hey, @friendsmobile!
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!