Skip to content

The crash occurs when searching for a non-existent folder and sorting by name. #4432

@buluu97

Description

@buluu97

Describe the bug
The crash occurs when searching for a non-existent folder and sorting by name.

To Reproduce
Steps to reproduce the behavior:

  1. Open the app's home page.
  2. Click on "Search."
  3. Type a folder name that should not exist in the list.
  4. Click the drop-down arrow at the bottom right of the search box to enter "Sort by."
  5. Select "Name" and click "Ascending."
  6. The app crashes.

Expected behavior
It should display a message like "No results matching the search criteria" instead of crashing.

Screenshots

amazebug.mp4

Smartphone (please complete the following information):

  • Device: [e.g. Google Pixel 9 Pro]
  • OS: [e.g. Android 9]
  • Rooted: [e.g. No]
  • Version: [e.g. 3.10 from APK Pure]

Logs

05-30 17:30:40.500  6043  6043 E AndroidRuntime: Process: com.amaze.filemanager, PID: 6043
05-30 17:30:40.500  6043  6043 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object[] java.util.Collection.toArray()' on a null object reference
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at java.util.ArrayList.<init>(ArrayList.java:191)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at com.amaze.filemanager.ui.views.appbar.SearchView.updateResultList(SearchView.java:375)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at com.amaze.filemanager.ui.views.appbar.SearchView.onSortTypeSelected(SearchView.java:481)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at com.amaze.filemanager.ui.views.appbar.SearchView.lambda$showSearchResultsSortDialog$10(SearchView.java:464)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at com.amaze.filemanager.ui.views.appbar.SearchView.$r8$lambda$2i4K5Lmbv48UVtMgrOeSwx46nss(Unknown Source:0)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at com.amaze.filemanager.ui.views.appbar.SearchView$$ExternalSyntheticLambda9.onClick(Unknown Source:2)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at com.afollestad.materialdialogs.MaterialDialog.onClick(MaterialDialog.java:433)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at android.view.View.performClick(View.java:7448)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at android.view.View.performClickInternal(View.java:7425)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at android.view.View.access$3600(View.java:810)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at android.view.View$PerformClick.run(View.java:28305)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at android.os.Handler.handleCallback(Handler.java:938)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at android.os.Handler.dispatchMessage(Handler.java:99)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at android.os.Looper.loop(Looper.java:223)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at android.app.ActivityThread.main(ActivityThread.java:7656)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at java.lang.reflect.Method.invoke(Native Method)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
05-30 17:30:40.500  6043  6043 E AndroidRuntime:         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions