thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/mobile
Apache License 2.0
11.07k stars 2.51k forks source link

Draft email crashes K-9 #8603

Open ByteHamster opened 5 days ago

ByteHamster commented 5 days ago

Checklist

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

kingqueen3065 commented 5 days ago

Thank you

In case it helps: Android 14, kernel version 5.15.123-android13-8-29539737-abS918BXXS6CXI4 #1 Mon Sep 30 10:18:14 UTC 2024 K9 from Google Play Store on a Galaxy S23 Ultra SM-S918B/DS.

I wrote a long draft email; the preview in the drafts folder shows fine, clicking on it results in crash. Wondered if it was the keyboard, changed that, no different. Other than when clicking on that draft email, everything works fine. I also tried deleting K9's cache to see if that helped. It has 1.42Gb in cache. But I'm unable to clear it. "Clear cache" in Android app settings only reduces the cache to 1.38Gb.

I would dearly love the contents of that draft email if it is at all possible to access it; would save substantial time and re-traumatising (it is a detailed account of a significant disability access refusal.)

Thank you

kewisch commented 4 days ago

The only option I'm aware of is to recover the draft from a different app (e.g. Thunderbird Desktop) if you use imap, or us potentially finding the root cause of this issue and then fixing it. Was there anything unusual about the draft, or was it mainly text?

kingqueen3065 commented 4 days ago

Thank you - ah okay. It isn't a synced folder, it is a POP3 / SMTP account. It was quite a long text. Written by me using the keyboard; nothing pasted so no weird encoded characters or anything. There may have been a couple of photos attached.