AkaneTan / Gramophone

A sane music player built with media3 and material design library that is following android's standard strictly.
GNU General Public License v3.0
802 stars 49 forks source link

[BUG] Crashed when double-clicking .. in the filesystem tab #174

Closed DanrDoesCode closed 1 month ago

DanrDoesCode commented 1 month ago

Describe the bug The app crashed when i double tapped ".." folder

To Reproduce Steps to reproduce the behavior:

  1. Open Gramaphone
  2. Navigate to "File system" or "Folder"
  3. Click any folder
  4. Spamclick the folder labelled ".." at the very top
  5. Crashed.

Expected behavior It should be able to handle those situation

Screenshots Gramophone version: 1.0.5.f3ad1a

Brand: samsung Model: SM-A600G SDK Level: 29 Thread: main

Time: 2024-05-08 16:07:06

--------- beginning of crash
java.util.NoSuchElementException: List is empty.
    at kotlin.collections.CollectionsKt__ReversedViewsKt.removeLast(SourceFile:24)
    at org.akanework.gramophone.ui.adapters.FolderAdapter.enter(SourceFile:45)
    at org.akanework.gramophone.logic.ui.BugHandlerActivity$$ExternalSyntheticLambda0.onClick(SourceFile:132)
    at android.view.View.performClick(View.java:7862)
    at android.view.View.performClickInternal(View.java:7831)
    at android.view.View.access$3600(View.java:879)
    at android.view.View$PerformClick.run(View.java:29359)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

I can send you a screen record of me reproducing the issue if you are still confused with what I mean

Smartphone (please complete the following information):

Additional context i dont have any