question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash: NPE in LocalStore.getRawAttachmentInputStream()

See original GitHub issue

Via Play Developer Console Version: 5.200 or 5.201

java.lang.NullPointerException: Attempt to get length of null array
	at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:60)
	at com.fsck.k9.mailstore.LocalStore.getRawAttachmentInputStream(LocalStore.java:873)
	at com.fsck.k9.mailstore.LocalStore.writeSimplePartToOutputStream(LocalStore.java:857)
	at com.fsck.k9.mailstore.LocalStore.writeCursorPartsToOutputStream(LocalStore.java:746)
	at com.fsck.k9.mailstore.LocalStore.access$300(LocalStore.java:78)
	at com.fsck.k9.mailstore.LocalStore$16.doDbWork(LocalStore.java:722)
	at com.fsck.k9.mailstore.LocalStore$16.doDbWork(LocalStore.java:714)
	at com.fsck.k9.mailstore.LockableDatabase.execute(LockableDatabase.java:275)
	at com.fsck.k9.mailstore.LocalStore.writeAttachmentDataToOutputStream(LocalStore.java:714)
	at com.fsck.k9.mailstore.LocalStore.access$100(LocalStore.java:78)
	at com.fsck.k9.mailstore.LocalStore$15.writeTo(LocalStore.java:706)
	at org.openintents.openpgp.util.ParcelFileDescriptorUtil$DataSourceTransferThread.run(ParcelFileDescriptorUtil.java:118)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cketticommented, Jan 1, 2017

Looks like we use DataLocation.IN_DATABASE for multiparts rather than DataLocation.CHILD_PART_CONTAINS_DATA. See https://github.com/k9mail/k-9/blob/de60e0e8c4105af957db647898511a584ac5e6aa/k9mail/src/main/java/com/fsck/k9/mailstore/LocalFolder.java#L1441

0reactions
Valodimcommented, Jan 2, 2017

I agree. I don’t think there is currently any code that relies on this, and we can also do a migration that does if (mimeType == multipart/* && dataLocation == IN_DATABASE) dataLocation = CHILD_PART_CONTAINS_DATA

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash: NPE in LocalStore.getRawAttachmentInputStream ...
Via Play Developer Console Version: 5.200 or 5.201 java.lang.NullPointerException: Attempt to get length of null array at java.io.
Read more >
Android app crashes opening InputStream from an XML
I made a SAX parser that accepts an InputStream as file to parse. If I use a local file it works, but if...
Read more >
Bug List - Bugs - Eclipse
Valenta, RESO, INVA, 'add' refreshes too much from local, 2002-03-20 ... dj.houghton, RESO, INVA, [UI] Workspace in odd state after crash while loading....
Read more >
New Feature - Release Notes - Java Bug System
entrySet().spliterator() reports SORTED + null comparator but the elements are not Comparable; [JDK-8020016] - Numerous splitereator impls do not throw NPE ...
Read more >
Browse Android-security Answers - Code Matcher
Migrating local storage from Cordova app to Android App ... InputStream returning NullPointerException (Java) · Android 2.2 SSL Bug with client certificate?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found