thunderbird / thunderbird/thunderbird-android

Draft email crashes K-9

Open
#8,603 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: crash unconfirmed
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

K-9 Mail

App version

8.1

Where did you get the app from?

Other

Android version

probably doesn't matter in this case

Device model

?

Steps to reproduce
  1. Click a draft email

See forum: https://forum.k9mail.app/t/draft-email-crashes-k9/11042

Expected behavior

Draft is shown

Actual behavior

App crashes

Logs
Shutting down VM
FATAL EXCEPTION: main
Process: com.fsck.k9, PID: 3487
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.substring(int, int)' on a null object reference
	at com.fsck.k9.ui.compose.QuotedMessagePresenter.processDraftMessage(QuotedMessagePresenter.java:287)
	at com.fsck.k9.activity.MessageCompose.processDraftMessage(MessageCompose.java:1451)
	at com.fsck.k9.activity.MessageCompose.processSourceMessage(MessageCompose.java:1262)
	at com.fsck.k9.activity.MessageCompose.loadLocalMessageForDisplay(MessageCompose.java:1659)
	at com.fsck.k9.activity.MessageCompose$11.onMessageViewInfoLoadFinished(MessageCompose.java:1679)
	at com.fsck.k9.activity.MessageLoaderHelper.onDecodeMessageFinished(MessageLoaderHelper.java:405)
	at com.fsck.k9.activity.MessageLoaderHelper.-$$Nest$monDecodeMessageFinished(MessageLoaderHelper.java:0)
	at com.fsck.k9.activity.MessageLoaderHelper$3.onLoadFinished(MessageLoaderHelper.java:441)
	at com.fsck.k9.activity.MessageLoaderHelper$3.onLoadFinished(MessageLoaderHelper.java:418)
	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:230)
	at android.os.Looper.loop(Looper.java:319)
	at android.app.ActivityThread.main(ActivityThread.java:9063)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Full log: https://www.kingqueen.org.uk/wp-content/uploads/2024/11/k9mail-logs.txt

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 com.fsck.k9.ui.compose.QuotedMessagePresenter.java:287 and trace the draft-opening callers shown in MessageCompose.java. Reproduce the issue by opening a draft email, then verify that the draft is displayed without the application crashing.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.