Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

java.lang.IllegalStateException: cursor.getString(nameIndex) must not be null #7983

Closed
Amejia481 opened this issue Aug 5, 2020 · 1 comment
Assignees
Labels
💥 crash E5 Estimation points: 5 <prompts> Component: feature-prompts
Milestone

Comments

@Amejia481
Copy link
Contributor

Amejia481 commented Aug 5, 2020

https://sentry.prod.mozaws.net/operations/firefox/issues/9300523/


java.lang.IllegalStateException: cursor.getString(nameIndex) must not be null
    at kotlin.jvm.internal.ArrayIteratorKt.checkExpressionValueIsNotNull(ArrayIterator.kt:1)
    at mozilla.components.browser.engine.gecko.prompt.GeckoPromptDelegate.toFileUri(GeckoPromptDelegate.kt:9)
    at mozilla.components.browser.engine.gecko.prompt.GeckoPromptDelegate.access$toFileUri(GeckoPromptDelegate.kt:1)
    at mozilla.components.browser.engine.gecko.prompt.GeckoPromptDelegate$onFilePrompt$onSelectSingle$1.invoke(GeckoPromptDelegate.kt:3)
    at mozilla.components.feature.prompts.file.FilePicker.handleFilePickerIntentResult$feature_prompts_release(FilePicker.kt:16)
    at mozilla.components.feature.prompts.file.FilePicker$onActivityResult$1.invoke(FilePicker.kt:5)
    at androidx.core.app.AppOpsManagerCompat.consumePromptFrom(AppOpsManagerCompat.java:5)
    at androidx.core.app.AppOpsManagerCompat.consumePromptFrom$default(AppOpsManagerCompat.java:1)
    at mozilla.components.feature.prompts.file.FilePicker.onActivityResult(FilePicker.kt:1)
    at mozilla.components.feature.prompts.PromptFeature.onActivityResult(PromptFeature.kt:1)
    at org.mozilla.fenix.browser.BaseBrowserFragment$onActivityResult$1.invoke(BaseBrowserFragment.kt:3)
    at mozilla.components.support.base.feature.ViewBoundFeatureWrapper.withFeature(ViewBoundFeatureWrapper.kt:1)
    at org.mozilla.fenix.browser.BaseBrowserFragment.onActivityResult(BaseBrowserFragment.kt:1)
    at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:7)
    at android.app.Activity.dispatchActivityResult(Activity.java:7797)
    at android.app.ActivityThread.deliverResults(ActivityThread.java:5071)
    at android.app.ActivityThread.handleSendResult(ActivityThread.java:5120)
    at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
    at android.os.Handler.dispatchMessage(Handler.java:112)
    at android.os.Looper.loop(Looper.java:216)
    at android.app.ActivityThread.main(ActivityThread.java:7625)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=72649, result=-1, data=Intent { dat=content://media/external/file/37162 typ=application/vnd.openxmlformats-officedocument.wordprocessingml.document flg=0x3 }} to activity {org.mozilla.firefox/org.mozilla.fenix.HomeActivity}: java.lang.IllegalStateException: cursor.getString(nameIndex) must not be null
    at android.app.ActivityThread.deliverResults(ActivityThread.java:5078)
    at android.app.ActivityThread.handleSendResult(ActivityThread.java:5120)
    at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
    at android.os.Handler.dispatchMessage(Handler.java:112)
    at android.os.Looper.loop(Looper.java:216)
    at android.app.ActivityThread.main(ActivityThread.java:7625)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)

┆Issue is synchronized with this Jira Task

@Amejia481 Amejia481 added <prompts> Component: feature-prompts 💥 crash R79 labels Aug 5, 2020
@Amejia481 Amejia481 removed the R79 label Aug 5, 2020
@Amejia481 Amejia481 self-assigned this Aug 5, 2020
Amejia481 added a commit to Amejia481/android-components that referenced this issue Aug 12, 2020
Amejia481 added a commit to Amejia481/android-components that referenced this issue Aug 12, 2020
Amejia481 added a commit to Amejia481/android-components that referenced this issue Aug 13, 2020
Amejia481 added a commit to Amejia481/android-components that referenced this issue Aug 13, 2020
bors bot pushed a commit that referenced this issue Aug 17, 2020
8104: Closes issue #7983: Generate a file name when the content provider doesn't provide one. r=pocmo a=Amejia481

When we get an `uri` from a file provider, we were trusting the provider to always provide a valid file name (`DISPLAY_NAME`) that is not always true, as we can see crashes on #7983, now when we can't find the file name, we are trying to generate a file name as it's required for the [file to be updated](https://github.com/mozilla-mobile/android-components/blob/0aff44eb2797c05d7bc28edc9cb0ebc5409371b4/components/browser/engine-gecko-nightly/src/main/java/mozilla/components/browser/engine/gecko/prompt/GeckoPromptDelegate.kt#L541).



Co-authored-by: Arturo Mejia <[email protected]>
@Amejia481
Copy link
Contributor Author

closed by #8104

@Amejia481 Amejia481 added the E5 Estimation points: 5 label Aug 17, 2020
@Amejia481 Amejia481 added this to the 55.0.0 💨 milestone Aug 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💥 crash E5 Estimation points: 5 <prompts> Component: feature-prompts
Projects
None yet
Development

No branches or pull requests

1 participant