You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeException: Unable to start activity ComponentInfo{com.jetpack.android/org.wordpress.android.ui.posts.EditPostActivity}: java.lang.NullPointerException: autoCreateLinks(...) must not be null
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3946)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4126)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:108)
at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:195)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:157)
...
(9 additional frame(s) were not displayed)
NullPointerException: autoCreateLinks(...) must not be null
at org.wordpress.android.ui.posts.EditPostActivity.newPostFromShareAction(EditPostActivity.kt:451)
val content = migrateToGutenbergEditor(AutolinkUtils.autoCreateLinks(text))
at org.wordpress.android.ui.posts.EditPostActivity.handleIntentExtras(EditPostActivity.kt:665)
newPostFromShareAction()
at org.wordpress.android.ui.posts.EditPostActivity.onCreate(EditPostActivity.kt:533)
handleIntentExtras(intent.extras, isRestarting)
...
(15 additional frame(s) were not displayed)
The text was updated successfully, but these errors were encountered:
It doesn't seem that this was in-fact introduced in 24.8, but there was recent code refactoring the EditPostActivity to Kotlin which caused this new crash signature when the text passed to autoCreateLinks is null, I believe.
@zwarm since you probably know more about this context and the Kotlin conversion, I am assigning you to the crash, but feel free to assign to someone else if it makes sense.
I did a quick investigation and it looks like the issue is that autoCreateLinks can return null, but it's not marked as @Nullable, so the Kotlin code doesn't complain in compilation time and crashes in that scenario in runtime.
@thomashorta - Exactly. In the java class only the first use of autoCreateLinks was checking for nulls before usage, the second use of the method was not. I am raising a PR against release/24.8 to check for nulls and if so, then send empty text instead. The jave code would have also crashed because it did not prevent nulls from being passed along. :(
Sentry Issue: JETPACK-ANDROID-R4R
The text was updated successfully, but these errors were encountered: