tuxmobil / CampFahrplan

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

NumberFormatException in AlarmReceiver #162

Closed johnjohndoe closed 7 years ago

johnjohndoe commented 8 years ago

I noticed the following NumberFormatException happened multiple times within the last months on several different instances of the app:

java.lang.RuntimeException: 
  Unable to start receiver nerd.tuxmobil.fahrplan.congress.AlarmReceiver:
java.lang.NumberFormatException: Invalid int: "null"
  at android.app.ActivityThread.handleReceiver(ActivityThread.java:2732)
  at android.app.ActivityThread.-wrap14(ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5417)
  at java.Iang.reflectMethod.invoke(Native Method)
  at com.android.internal.os.Zygotelnit$MethodAndArgsCalIer.run(Zygotelnit.java:726)
  at com.android.internal.os.Zygotelnit.main(Zygotelnit.java:616)

Caused by: java.lang.NumberFormatException: Invalid int: "null"
  at java.lang.Integer.invalidlnt(lnteger.java:138)
  at java.lang.Integer.parselnt(lnteger.java:358)
  at java.lang.Integer.parselnt(lnteger.java:334)
  at nerd.tuxmobil.fahrplan.congress.AlarmReceiver.onReceive(AlarmReceiver.java:39)
  at android.app.ActivityThread.handleReceiver(ActivityThread.java:2725)
8 more

Log:
1 D: onReceive: lecture_id: null, intent: Intent { 
    act=nerd.tuxmobil.fahrplan.congress.ALARM_LECTURE 
    dat=alarm://1563 flg=0x14 cmp=info.metadude.android.fossgis.schedule.debug/
    nerd.tuxmobil.fahrplan.congress.AlarmReceiver (has extras)
2 D: Set alarm for lecture: 1563
3 D: Set alarm for lecture: 1353
4 D: current handler class=com.android.internal.os.Runtimelnit$UncaughtHandler

Finally, I managed to figured out how to reproduce it.

Steps to reproduce

  1. Set the date & time on the device to values before the event
  2. Launch the app and add an alarm
  3. Reboot the device
  4. Set the date & time on the device to values after the event
  5. The app crashes and the above error shows up
johnjohndoe commented 7 years ago

:white_check_mark: Resolved here: https://github.com/EventFahrplan/EventFahrplan/commit/a4231b82a2e66d540badf2c8f579e5b7f763b439