Ixam97 / CarStatsViewer

MIT License
96 stars 54 forks source link

Bug: Changing selcted trip fails #231

Open Ixam97 opened 3 months ago

Ixam97 commented 3 months ago
02.06.2024 10:05:33.021 E: [NEO] Car Stats Viewer has crashed!
 java.util.NoSuchElementException: Collection contains no element matching the predicate.
    at com.ixam97.carStatsViewer.dataProcessor.DataProcessor.changeSelectedTrip(DataProcessor.kt:864)
    at com.ixam97.carStatsViewer.dataProcessor.DataProcessor.checkTrips(DataProcessor.kt:404)
    at com.ixam97.carStatsViewer.dataProcessor.DataProcessor$checkTrips$1.invokeSuspend(Unknown Source:13)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@405ccc7, Dispatchers.IO]
Ixam97 commented 1 month ago

Added some error handling to this in 967f189. This should prevent App crashes and give some more insights on the issue.

Also see https://github.com/Ixam97/CarStatsViewer/issues/232#issuecomment-2291899480. I suspect the same root cause for both of these issues.