ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

App crashes when same folder is added twice as Favorite #89

Closed melvin4u445 closed 3 years ago

melvin4u445 commented 3 years ago

Steps:

  1. Add a folder as root (DCIM, for example)
  2. Add one of its subfolder as a Favorite (DCIM/Camera for example)
  3. Add the same folder again as Favorite App crashes

Crash log:

--------- beginning of crash
10-03 20:36:00.271  2032  2032 E AndroidRuntime: FATAL EXCEPTION: main
10-03 20:36:00.271  2032  2032 E AndroidRuntime: Process: space.taran.arknavigator, PID: 2032
10-03 20:36:00.271  2032  2032 E AndroidRuntime: java.lang.AssertionError: Path must be checked in RootPicker
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at space.taran.arknavigator.mvp.presenter.FoldersPresenter$addFavorite$1.invokeSuspend(FoldersPresenter.kt:181)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:873)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:216)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7211)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
10-03 20:36:00.271  2032  2032 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
10-03 20:36:00.297  2032  2032 I Process : Sending signal. PID: 2032 SIG: 9
kirillt commented 3 years ago

Folder picker must disable pick button when it is inside of a folder which is already added. Kinda similar to #64.

kirillt commented 3 years ago

@melvin4u445 could you test PR #108?

melvin4u445 commented 3 years ago

Cannot reproduce this now. Looks good

kirillt commented 3 years ago

@melvin4u445 don't close please until it's merged into main branch.

kirillt commented 3 years ago

Merged now.