wordpress-mobile / wordpress-mobile/WordPress-Android

NullPointerException

Open
#20,948 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Crash Posting/Editing
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

Sentry Issue: WORDPRESS-ANDROID-2YSX

NullPointerException: None
    at org.wordpress.android.ui.posts.EditPostRepository.getFeaturedImageId(EditPostRepository.kt:84)
    get() = post!!.featuredImageId
    at org.wordpress.android.ui.posts.EditPostActivity.getGutenbergPropsBuilder(EditPostActivity.kt:2458)
    val featuredImageId = editPostRepository.featuredImageId.toInt()
    at org.wordpress.android.ui.posts.EditPostActivity.onXpostsSettingsCapability(EditPostActivity.kt:2451)
    (editorFragment as GutenbergEditorFragment).updateCapabilities(gutenbergPropsBuilder)
    at org.wordpress.android.ui.posts.EditPostActivity.access$updateOnSuccessfulUpload(EditPostActivity.kt:260)
    @Suppress("LargeClass")
    at org.wordpress.android.ui.posts.EditPostActivity.access$onXpostsSettingsCapability(EditPostActivity.kt:260)
    @Suppress("LargeClass")
...
(14 additional frame(s) were not displayed)

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 with the Sentry stack trace and inspect EditPostRepository.kt at getFeaturedImageId, then follow its use in EditPostActivity.kt at getGutenbergPropsBuilder and onXpostsSettingsCapability. Determine why post can be null on this path and define completion as preventing the NullPointerException without breaking the capability update flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.