sk22 / megalodon

Pink modification of the official Mastodon for Android app
https://sk22.github.io/megalodon
GNU General Public License v3.0
550 stars 33 forks source link

Crash on startup after update #539

Closed LucasGGamerM closed 1 year ago

LucasGGamerM commented 1 year ago

Describe the bug

Crash on startup

To reproduce

Steps to reproduce the behavior:

Update Megalodon to version new pre release Does this happen in the official app?

No

In case it does, please consider filing an upstream bug report instead. If this bug is seriously impacting your usage or you think I might want to try to fix it for Megalodon, feel free to still create this issue!

Screenshots and screen recordings

If applicable, add screenshots (and screen recordings, if possible) to help explain your problem.

Version

Megalodon version: [e.g. v1.2.3+fork.86]

Crash log

FATAL EXCEPTION: main
                                                                                                    Process: org.joinmastodon.android.sk, PID: 12847
                                                                                                    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.joinmastodon.android.sk/org.joinmastodon.android.MainActivity}: java.lang.NullPointerException: Attempt to read from field 'java.util.List org.joinmastodon.android.model.Instance$Pleroma$Metadata.features' on a null object reference in method 'java.lang.Boolean org.joinmastodon.android.model.TimelineDefinition$1.lambda$wantsDefault$0(org.joinmastodon.android.model.Instance)'
                                                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3641)
                                                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3778)
                                                                                                        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
                                                                                                        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
                                                                                                        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2303)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                        at android.os.Looper.loop(Looper.java:288)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:7884)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
                                                                                                    Caused by: java.lang.NullPointerException: Attempt to read from field 'java.util.List org.joinmastodon.android.model.Instance$Pleroma$Metadata.features' on a null object reference in method 'java.lang.Boolean org.joinmastodon.android.model.TimelineDefinition$1.lambda$wantsDefault$0(org.joinmastodon.android.model.Instance)'
                                                                                                        at org.joinmastodon.android.model.TimelineDefinition$1.lambda$wantsDefault$0(TimelineDefinition.java:268)
                                                                                                        at org.joinmastodon.android.model.TimelineDefinition$1$$ExternalSyntheticLambda0.apply(Unknown Source:2)
                                                                                                        at j$.util.Optional.map(SourceFile:0)
                                                                                                        at org.joinmastodon.android.model.TimelineDefinition$1.wantsDefault(TimelineDefinition.java:268)
                                                                                                        at org.joinmastodon.android.model.TimelineDefinition.lambda$getDefaultTimelines$0(TimelineDefinition.java:276)
                                                                                                        at org.joinmastodon.android.model.TimelineDefinition$$ExternalSyntheticLambda2.test(Unknown Source:4)
                                                                                                        at j$.util.stream.ReferencePipeline$2$1.accept(SourceFile:0)
                                                                                                        at j$.util.Spliterators$IteratorSpliterator.forEachRemaining(SourceFile:0)
                                                                                                        at j$.util.stream.AbstractPipeline.copyInto(SourceFile:0)
                                                                                                        at j$.util.stream.AbstractPipeline.wrapAndCopyInto(SourceFile:0)
                                                                                                        at j$.util.stream.Node$-CC.evaluateSequential(Unknown Source:4)
                                                                                                        at j$.util.stream.AbstractPipeline.evaluate(SourceFile:0)
                                                                                                        at j$.util.stream.ReferencePipeline.collect(SourceFile:0)
                                                                                                        at org.joinmastodon.android.model.TimelineDefinition.getDefaultTimelines(TimelineDefinition.java:278)
                                                                                                        at org.joinmastodon.android.fragments.HomeTabFragment.onCreate(HomeTabFragment.java:111)
                                                                                                        at android.app.Fragment.performCreate(Fragment.java:2486)
                                                                                                        at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1261)
                                                                                                        at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2431)
                                                                                                        at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2210)
                                                                                                        at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2166)
                                                                                                        at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2067)
                                                                                                        at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3057)
                                                                                                        at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3004)
                                                                                                        at android.app.Fragment.performActivityCreated(Fragment.java:2520)
                                                                                                        at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1323)
                                                                                                        at android.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1581)
                                                                                                        at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1642)
                                                                                                        at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3052)
2023-06-01 13:46:30.452 12847-12847 AndroidRuntime          pid-12847                            E      at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3004)
                                                                                                        at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:185)
                                                                                                        at android.app.Activity.performCreate(Activity.java:8349)
                                                                                                        at android.app.Activity.performCreate(Activity.java:8320)
                                                                                                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1421)
                                                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3622)
sk22 commented 1 year ago

that's weird... this would imply that the pleroma object was not null at some point (else, isPleroma() would've failed, right?!), but its "metadata" was still null. were you trying to connect to a pleroma/akkoma instance? 🤔

LucasGGamerM commented 1 year ago

I don't exactly remember which account was active at the time of the update, and wiping the apps data fixed it too. Maybe this has something to do with me being on version 83 before updating

sk22 commented 1 year ago

hrmm.. weird