Docile-Alligator / Infinity-For-Reddit

A Reddit client for Android
https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforreddit
GNU Affero General Public License v3.0
4.24k stars 408 forks source link

Application crash when viewing multireddit #1709

Closed bgh80 closed 2 months ago

bgh80 commented 2 months ago

Checklist

App version

7.3.0

Where did you get the app from

Other

Android version

14

Device model

Google Pixel 9 Pro Fold

First occurred

1 day aggo

Steps to reproduce

First time user of the app after getting a new phone and building via colab script. After logging in and selecting my existing multireddit I am getting an app crash.

Sorry not very helpful for reproducing I know but hopefully the stack trace can assist.

Example post, link, markdown...

No response

Expected behaviour

Open the multireddit.

Current behaviour

No response

Logs

`` Stacktrace ``

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
    at ml.docilealligator.infinityforreddit.post.PostPagingSource.<init>(PostPagingSource.java:121)
    at ml.docilealligator.infinityforreddit.post.PostViewModel.returnPagingSoruce(PostViewModel.java:288)
    at ml.docilealligator.infinityforreddit.post.PostViewModel$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0)
    at androidx.paging.Pager$flow$2.invokeSuspend(Pager.kt:93)
    at androidx.paging.Pager$flow$2.invoke(Unknown Source:8)
    at androidx.paging.Pager$flow$2.invoke(Unknown Source:2)
    at androidx.paging.PageFetcher.generateNewPagingSource(PageFetcher.kt:210)
    at androidx.paging.PageFetcher.access$generateNewPagingSource(PageFetcher.kt:32)
    at androidx.paging.PageFetcher$flow$1$2.invokeSuspend(PageFetcher.kt:73)
    at androidx.paging.PageFetcher$flow$1$2.invoke(Unknown Source:15)
    at androidx.paging.PageFetcher$flow$1$2.invoke(Unknown Source:10)
    at androidx.paging.FlowExtKt$simpleScan$1$1.emit(FlowExt.kt:56)
    at kotlinx.coroutines.flow.internal.SafeCollectorKt$emitFun$1.invoke(SafeCollector.kt:15)
    at kotlinx.coroutines.flow.internal.SafeCollectorKt$emitFun$1.invoke(SafeCollector.kt:15)
    at kotlinx.coroutines.flow.internal.SafeCollector.emit(SafeCollector.kt:87)
    at kotlinx.coroutines.flow.internal.SafeCollector.emit(SafeCollector.kt:66)
    at androidx.paging.PageFetcher$flow$1$1.invokeSuspend(PageFetcher.kt:63)
    at androidx.paging.PageFetcher$flow$1$1.invoke(Unknown Source:8)
    at androidx.paging.PageFetcher$flow$1$1.invoke(Unknown Source:4)
    at kotlinx.coroutines.flow.FlowKt__EmittersKt$onStart$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:117)
    at androidx.paging.FlowExtKt$simpleScan$1.invokeSuspend(FlowExt.kt:55)
    at androidx.paging.FlowExtKt$simpleScan$1.invoke(Unknown Source:8)
    at androidx.paging.FlowExtKt$simpleScan$1.invoke(Unknown Source:4)
    at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
    at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
    at kotlinx.coroutines.flow.FlowKt__TransformKt$filterNotNull$$inlined$unsafeTransform$1.collect(SafeCollector.common.kt:114)
    at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invokeSuspend(Merge.kt:27)
    at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(Unknown Source:8)
    at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(Unknown Source:4)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
    at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
    at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest.flowCollect(Merge.kt:25)
    at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
    at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0)
    at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:68)
    at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:375)
    at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
    at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
    at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:110)
    at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
    at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
    at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1)
    at androidx.lifecycle.BlockRunner.maybeRun(CoroutineLiveData.kt:175)
    at androidx.lifecycle.CoroutineLiveData.onActive(CoroutineLiveData.kt:241)
    at androidx.lifecycle.LiveData.changeActiveCounter(LiveData.java:405)
    at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:481)
    at androidx.lifecycle.LiveData$LifecycleBoundObserver.onStateChanged(LiveData.java:440)
    at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:322)
    at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:199)
    at androidx.lifecycle.LiveData.observe(LiveData.java:205)
    at ml.docilealligator.infinityforreddit.fragments.PostFragment.bindPostViewModel(PostFragment.java:1241)
    at ml.docilealligator.infinityforreddit.fragments.PostFragment.initializeAndBindPostViewModel(PostFragment.java:1211)
    at ml.docilealligator.infinityforreddit.fragments.PostFragment.lambda$onCreateView$3$ml-docilealligator-infinityforreddit-fragments-PostFragment(PostFragment.java:931)
    at ml.docilealligator.infinityforreddit.fragments.PostFragment$$ExternalSyntheticLambda17.success(D8$$SyntheticClass:0)
    at ml.docilealligator.infinityforreddit.FetchPostFilterReadPostsAndConcatenatedSubredditNames.lambda$fetchPostFilterAndReadPosts$1(FetchPostFilterReadPostsAndConcatenatedSubredditNames.java:40)
    at ml.docilealligator.infinityforreddit.FetchPostFilterReadPostsAndConcatenatedSubredditNames$$ExternalSyntheticLambda2.run(D8$$SyntheticClass:0)
    at android.os.Handler.handleCallback(Handler.java:959)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8592)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@944f3fd, Dispatchers.Main.immediate]

`` END of stacktrace ``

`` Thread info ``

Name: main
ID: 2
State: RUNNABLE
Priority: 5
Thread group name: main
Thread group parent: system
Thread group active count: 36
Thread time: 0 hr 0 min, 4 sec

`` END of thread info ``

`` Device info ``

Report ID: 1367aaea-a8bb-4056-ba00-8412b050676e
Device ID: 40376e05a0bb50e5
Application version: 179
Default launcher: com.android.settings
Timezone name: Australian Eastern Standard Time
Timezone ID: Australia/Sydney
Version release: 14
Version incremental : 12021718
Version SDK: 34
Board: comet
Bootloader: ripcurrentpro-14.6-12019008
Brand: google
CPU ABIS 32: N/A
CPU ABIS 64: arm64-v8a
Supported ABIS: arm64-v8a
Device: com
Docile-Alligator commented 2 months ago

Fixed. https://github.com/Docile-Alligator/Infinity-For-Reddit/commit/478b2db4e583ff4577e421f1f115ef8d4d7626ef

Please build the app again.