App crashes when interacting with playlist
Describe the bug
App crashes when removing an item from a playlist or changing the position of songs within a playlist it's related to #83 (closed)
Logs
2022-02-23 10:49:17.716 4403-4403/audio.funkwhale.ffa.dev E/AndroidRuntime: FATAL EXCEPTION: main
Process: audio.funkwhale.ffa.dev, PID: 4403
java.lang.IllegalStateException: Illegal state: context is null
at audio.funkwhale.ffa.repositories.ManagementPlaylistsRepository.remove(PlaylistsRepository.kt:126)
at audio.funkwhale.ffa.repositories.ManagementPlaylistsRepository$remove$1.invokeSuspend(Unknown Source:19)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
move
2022-02-23 10:56:50.832 8910-8910/audio.funkwhale.ffa.dev E/AndroidRuntime: FATAL EXCEPTION: main
Process: audio.funkwhale.ffa.dev, PID: 8910
java.lang.IllegalStateException: Illegal state: context is null
at audio.funkwhale.ffa.repositories.ManagementPlaylistsRepository.move(PlaylistsRepository.kt:148)
at audio.funkwhale.ffa.fragments.PlaylistTracksFragment$PlaylistListener.onMoveTrack(PlaylistTracksFragment.kt:218)
at audio.funkwhale.ffa.adapters.PlaylistTracksAdapter$TouchHelperCallback.clearView(PlaylistTracksAdapter.kt:222)
at androidx.recyclerview.widget.ItemTouchHelper$3.onAnimationEnd(ItemTouchHelper.java:647)
at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:554)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1250)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1492)
at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:727)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)