tuxmobil / CampFahrplan

View the conference schedule of the Chaos Communcation Camp/Congress
59 stars 23 forks source link

NullPointerException when adding event to favorites after language change #151

Closed johnjohndoe closed 7 years ago

johnjohndoe commented 8 years ago

Test environment

java.lang.NullPointerException: Attempt to write to field 'boolean 
    nerd.tuxmobil.fahrplan.congress.Lecture.highlight' on a null object reference
    at nerd.tuxmobil.fahrplan.congress.EventDetailFragment.onOptionsItemSelected(EventDetailFragment.java:312)
    at android.support.v4.app.Fragment.performOptionsItemSelected(Fragment.java:2070)
    at android.support.v4.app.FragmentManagerImpl.dispatchOptionsItemSelected(FragmentManager.java:2159)
    at android.support.v4.app.FragmentController.dispatchOptionsItemSelected(FragmentController.java:295)
    at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:367)
    at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:147)

Quick fix

johnjohndoe commented 7 years ago

:white_check_mark: Resolved here: https://github.com/EventFahrplan/EventFahrplan/commit/3045e8eefc720b97f42b555c1569ccb15a151fa5

junior291492659 commented 5 years ago

✅ Resolved here: EventFahrplan@3045e8e

hello, I can not understand why 'lecture' becomes null after the system language has been changed.It would appreciated to be replyed with explaination.Thanks! @johnjohndoe

johnjohndoe commented 5 years ago

@junior291492659 The solution from 2016 looks like a quick fix to me. I believe it would take a bit of time to dig into the problem to find the real reason. - Do you have a particular idea about the case?

junior291492659 commented 5 years ago

@junior291492659 The solution from 2016 looks like a quick fix to me. I believe it would take a bit of time to dig into the problem to find the real reason. - Do you have a particular idea about the case?

Hi, Thanks a lot for replying.really appreciated :). @johnjohndoe I tried to read the relevant source code but I can not figure it out since it can be chanlenging. Your quick fix is adding a judgement of nullness of 'lecture'. According to the issue description, the observed behavior after the reproduce steps contains of clicking on the favorate button which causes the crash. I wonder is the event details shown smoothly in the new language you changed to after resume ,then the action of clicking causes the crash. I am sorry for not offering any idea about this issue but I am courious about the reason of 'lecture' becoming null after the system language has been changed so I searched for your help considering you are one of the contributors of this project. Thanks.

johnjohndoe commented 5 years ago

As a general advice, please do not take any solution/implementation for granted. Question all the things. As indicated before I believe that this particular fix has been a quick fix to mitigate the crashing effect not the source of the problem. The easiest way to find out if the issue is still around would be to remove the null-check, compile and run the project and follow the steps to reproduce the crash. While doing that I like to point you to the EventFahrplan repository where the project is maintained since August 2017. - Please let me know if you need any help with that. One question from my side: how comes that you are interested in this particular issue (since it has been closed for a while)?