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

NullPointerException from getDateTime during export #42

Closed
jgriffiths opened this issue May 20, 2016 · 8 comments
Closed

NullPointerException from getDateTime during export #42

jgriffiths opened this issue May 20, 2016 · 8 comments
Assignees
Labels
bug Potential or manifest misfunction, release-blocking.

Comments

@jgriffiths
Copy link
Contributor

Captured logcat output as requested. The XDA forum post was very helpful (thanks @jgriffiths), and I ended up doing the following:

  • Enabled 'Developer mode' and 'Debug logging' under Settings (in Calendar Import/Export).
  • Started recording the logcat on my (Linux) laptop with adb logcat -v long > phone.log
  • Used the application as described in the tests below.
  • Ran sed -n '/ICS_/,/^\r$/p' < phone.log > bugtest.log to extract requested sections. (Needed the \r to match "empty" lines, since logcat outputs DOS line endings.)

Test 1: Successfully export a local calendar (id 7, with 30 items):

[ 05-19 20:56:28.939  4563:14208 I/ICS_SaveCalendar ]
Save id 7 to file /storage/emulated/0/bugtest.ics

[ 05-19 20:56:28.955  4563:14208 E/ICS_SaveCalendar ]
Failed to create mailTo for organizer mailto:Local Calendar

{...then just 29 more copies of this mailTo error...}

Test 2: Trigger bug when exporting a local calendar (id 6):

[ 05-19 20:56:54.025  4563:14223 I/ICS_SaveCalendar ]
Save id 6 to file /storage/emulated/0/bugtest.ics

[ 05-19 20:56:54.041  4563:14223 E/ICS_SaveCalendar ]
Failed to create mailTo for organizer mailto:Local Calendar

[ 05-19 20:56:54.142  4563:14223 E/ICS_SaveCalendar ]
Failed to create mailTo for organizer mailto:Local Calendar

[ 05-19 20:56:54.142  4563:14223 E/ICS_RunnableWithProgress ]
An exception occurred
java.lang.NullPointerException
        at org.sufficientlysecure.ical.SaveCalendar.getDateTime(Unknown Source)
        at org.sufficientlysecure.ical.SaveCalendar.convertFromDb(Unknown Source)
        at org.sufficientlysecure.ical.SaveCalendar.run(Unknown Source)
        at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:856)

Test 3: Trigger same bug when exporting a Google calendar (id 1):

[ 05-19 20:57:13.275  4563:14513 I/ICS_SaveCalendar ]
Save id 1 to file /storage/emulated/0/bugtest.ics

[ 05-19 20:57:16.439  4563:14513 E/ICS_RunnableWithProgress ]
An exception occurred
java.lang.NullPointerException
        at org.sufficientlysecure.ical.SaveCalendar.getDateTime(Unknown Source)
        at org.sufficientlysecure.ical.SaveCalendar.convertFromDb(Unknown Source)
        at org.sufficientlysecure.ical.SaveCalendar.run(Unknown Source)
        at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:856)

I also captured some verbose logcat output with adb logcat -v long '*:v' > phone.log, but this included masses of data, including a dump of each entry read and written, so I've not included it here. I can generate (and sanitize) more of that if it would help.

@jgriffiths
Copy link
Contributor Author

Log from @pdwhittaker on #33.

@jgriffiths jgriffiths self-assigned this May 20, 2016
jgriffiths added a commit that referenced this issue May 20, 2016
For #42. May fix the issue, if not hopefully tells us what is going wrong.
@jgriffiths
Copy link
Contributor Author

@pdwhittaker, let me know if you are able to test a debug .apk file, otherwise I will get @dschuermann to release this so you can test it (may take a while).

@jgriffiths jgriffiths added the bug Potential or manifest misfunction, release-blocking. label May 20, 2016
@dschuermann
Copy link
Member

I released 2.3

@pdwhittaker
Copy link

@jgriffiths, happy to try out a debug build. It's been a while since I sideloaded an apk though, so any "howto" pointers would be welcome. Will also keep an eye out for 2.3 becoming visible in F-Droid (no sign yet).

@dschuermann
Copy link
Member

@pdwhittaker F-Droid takes 1 day to get the newest version. They are checking for a new git tag once a day.

@Gitoffthelawn
Copy link

@pdwhittaker To sideload an apk, often all you have to do is temporarily allow Unknown Sources in Android's security settings (in Settings app). Then load the apk by using any of the better file managers available. Finally, remember to disable Unknown Sources after that apk is sideloaded.

Oh, and of course, perform thorough virus/malware scanning of any apk before you decide to sideload it.

@pdwhittaker
Copy link

pdwhittaker commented May 22, 2016

Many thanks @jgriffiths, appears to be fixed (for me at least).

F-Droid picked up 2.3 earlier today, I've now installed it, and both the local and the Google calendars that raised exceptions in the initial bug report are now exported without an error. Many thanks for the swift turnaround.

@jgriffiths
Copy link
Contributor Author

@pdwhittaker Glad this has fixed it for you. I would like to know what the timezone was that was not found, if it is a common one we may want to support it manually. The failed TZ should be listed in a debug log, if you could update here that would be great.

I suspect we may want an option for what to do with unknown timezones in the settings (default to UTC, use phone/calendar TZ etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Potential or manifest misfunction, release-blocking.
Projects
None yet
Development

No branches or pull requests

4 participants