Skip to content

App Crash On Search #2926

Open
Open
@satyajiit

Description

@satyajiit

Describe the bug
Clicking on Search Icon in the Toolbar Crash/Terminate the App

To Reproduce

  1. Store an image in the root directory or root of internal i.e /sdcard
  2. Run the App
  3. Click on Search Icon on the Toolbar or Actionbar
  4. App Crash

Expected behavior
Should work normally without crashing the App.

Logs

2019-11-19 05:13:05.307 12660-12660/org.fossasia.phimpme E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.fossasia.phimpme, PID: 12660
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference
        at org.fossasia.phimpme.gallery.activities.LFMainActivity.searchTitle(LFMainActivity.java:1712)
        at org.fossasia.phimpme.gallery.activities.LFMainActivity$33.onQueryTextChange(LFMainActivity.java:1645)
        at androidx.appcompat.widget.SearchView.onTextChanged(SearchView.java:1182)
        at androidx.appcompat.widget.SearchView$10.onTextChanged(SearchView.java:1720)
        at android.widget.TextView.sendOnTextChanged(TextView.java:10567)
        at android.widget.TextView.setText(TextView.java:6304)
        at android.widget.TextView.setText(TextView.java:6129)
        at android.widget.EditText.setText(EditText.java:122)
        at android.widget.TextView.setText(TextView.java:6081)
        at androidx.appcompat.widget.SearchView.onActionViewExpanded(SearchView.java:1296)
        at androidx.appcompat.widget.Toolbar$ExpandedActionViewMenuPresenter.expandItemActionView(Toolbar.java:2535)
        at androidx.appcompat.view.menu.MenuBuilder.expandItemActionView(MenuBuilder.java:1366)
        at androidx.appcompat.view.menu.MenuItemImpl.expandActionView(MenuItemImpl.java:830)
        at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:996)
        at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:981)
        at androidx.appcompat.widget.ActionMenuView.invokeItem(ActionMenuView.java:625)
        at androidx.appcompat.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:151)
        at android.view.View.performClick(View.java:7201)
        at android.view.View.performClickInternal(View.java:7170)
        at android.view.View.access$3500(View.java:806)
        at android.view.View$PerformClick.run(View.java:27562)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7682)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

GIF
ezgif com-video-to-gif

Screenshots
Screenshot_20191119-050705

Smartphone Info:

Device OnePlus7
Android Version Android 10 OxygenOS 10.0.2

Additional context
The Crash is caused only because album item is returning null when an image is stored in root directory i.e /sdcard .

Would you like to work on the issue?

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions