thunderbird / thunderbird/thunderbird-android

Crash when trying to open an encrypted draft without having a crypto provider configured

Open
#6,433 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
14k
Forks
2.8k
Avg merge
3d 3h
Merged PRs (30d)
57

Description

Checklist
  • I have used the search function to see if someone else has already submitted the same bug report.
  • I will describe the problem with as much detail as possible.
App version

6.309

Where did you get the app from?

Google Play

Android version

Android 13

Device model

No response

Steps to reproduce
  1. Put an encrypted message in your drafts folder
  2. Try to open the encrypted draft message without having a crypto provider configured
Expected behavior

Display an error message

Actual behavior

Crash

Logs

Stack trace (via Google Play Developer Console):

Exception java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
  at com.fsck.k9.activity.compose.AttachmentPresenter.loadAllAvailableAttachments (AttachmentPresenter.java:210)
  at com.fsck.k9.activity.MessageCompose.processDraftMessage (MessageCompose.java:1399)
  at com.fsck.k9.activity.MessageCompose.processSourceMessage (MessageCompose.java:1272)
  at com.fsck.k9.activity.MessageCompose.loadLocalMessageForDisplay (MessageCompose.java:1669)
  at com.fsck.k9.activity.MessageCompose$11.onMessageViewInfoLoadFinished (MessageCompose.java:1689)
  at com.fsck.k9.activity.MessageLoaderHelper.onDecodeMessageFinished (MessageLoaderHelper.java:401)
  at com.fsck.k9.activity.MessageLoaderHelper.access$1100 (MessageLoaderHelper.java:76)
  at com.fsck.k9.activity.MessageLoaderHelper$3.onLoadFinished (MessageLoaderHelper.java:437)
  at com.fsck.k9.activity.MessageLoaderHelper$3.onLoadFinished (MessageLoaderHelper.java:414)
  at androidx.loader.app.LoaderManagerImpl$LoaderObserver.onChanged (LoaderManagerImpl.java:250)
  at androidx.lifecycle.LiveData.considerNotify (LiveData.java:133)
  at androidx.lifecycle.LiveData.dispatchingValue (LiveData.java:151)
  at androidx.lifecycle.LiveData.setValue (LiveData.java:309)
  at androidx.lifecycle.MutableLiveData.setValue (MutableLiveData.java:50)
  at androidx.loader.app.LoaderManagerImpl$LoaderInfo.setValue (LoaderManagerImpl.java:189)
  at androidx.loader.app.LoaderManagerImpl$LoaderInfo.onLoadComplete (LoaderManagerImpl.java:174)
  at androidx.loader.content.Loader.deliverResult (Loader.java:132)
  at com.fsck.k9.ui.message.LocalMessageExtractorLoader.deliverResult (LocalMessageExtractorLoader.java:47)
  at com.fsck.k9.ui.message.LocalMessageExtractorLoader.deliverResult (LocalMessageExtractorLoader.java:16)
  at androidx.loader.content.AsyncTaskLoader.dispatchOnLoadComplete (AsyncTaskLoader.java:258)
  at androidx.loader.content.AsyncTaskLoader$LoadTask.onPostExecute (AsyncTaskLoader.java:83)
  at androidx.loader.content.ModernAsyncTask.finish (ModernAsyncTask.java:490)
  at androidx.loader.content.ModernAsyncTask$InternalHandler.handleMessage (ModernAsyncTask.java:507)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:201)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7898)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at AttachmentPresenter.loadAllAvailableAttachments() around line 210 and follow its call from MessageCompose.processDraftMessage(). Reproduce with an encrypted draft and no configured crypto provider, then verify that opening it displays an error message instead of crashing. Check the relevant compose and draft-loading tests, if present, for coverage of this path.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.