udacity / andfun-kotlin-sleep-tracker-with-recyclerview

Other
102 stars 229 forks source link

Step 03 Solution Crashes #31

Open melvyniandrag opened 1 year ago

melvyniandrag commented 1 year ago

Start, then rotate the screen then click stop. Crash.

2023-05-11 10:35:33.339 16812-16812/com.example.android.trackmysleepqualityrecyclerview E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.android.trackmysleepqualityrecyclerview, PID: 16812
    java.lang.IllegalStateException: no current navigation node
        at androidx.navigation.NavController.navigate(NavController.java:765)
        at androidx.navigation.NavController.navigate(NavController.java:745)
        at androidx.navigation.NavController.navigate(NavController.java:731)
        at androidx.navigation.NavController.navigate(NavController.java:863)
        at com.example.android.trackmysleepquality.sleeptracker.SleepTrackerFragment$onCreateView$2.onChanged(SleepTrackerFragment.kt:91)
        at com.example.android.trackmysleepquality.sleeptracker.SleepTrackerFragment$onCreateView$2.onChanged(SleepTrackerFragment.kt:38)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at com.example.android.trackmysleepquality.sleeptracker.SleepTrackerViewModel$onStopTracking$1.invokeSuspend(SleepTrackerViewModel.kt:224)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        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)
melvyniandrag commented 1 year ago

Just checked out the final version of the project to see if this is fixed in a later video and its still crashing.