Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crashes when clicking the GridView adapter of Bookmarks. #3531

Closed
gouri-panda opened this issue Mar 16, 2020 · 1 comment
Closed
Labels

Comments

@gouri-panda
Copy link
Contributor

Summary:
Application crashes when clicking the grid view after changing the theme in Bookmarks.

Steps to reproduce:

  • Go to the bookmarks section
  • Change the theme by going to the navigation drawer
  • Go back to the Bookmarks section
  • Select one image view in the Grid view

System logs:

    java.lang.NullPointerException: Attempt to invoke virtual method 'android.widget.ListAdapter android.widget.GridView.getAdapter()' on a null object reference
        at fr.free.nrw.commons.bookmarks.pictures.BookmarkPicturesFragment.getAdapter(BookmarkPicturesFragment.java:228)
        at fr.free.nrw.commons.bookmarks.BookmarksPagerAdapter.getMediaAdapter(BookmarksPagerAdapter.java:57)
        at fr.free.nrw.commons.bookmarks.BookmarksActivity.getTotalMediaCount(BookmarksActivity.java:137)
        at fr.free.nrw.commons.media.MediaDetailPagerFragment$MediaDetailAdapter.getCount(MediaDetailPagerFragment.java:384)
        at androidx.viewpager.widget.ViewPager.setAdapter(ViewPager.java:532)
        at fr.free.nrw.commons.media.MediaDetailPagerFragment.onCreateView(MediaDetailPagerFragment.java:100)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2440)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:885)
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1229)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1295)
        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:686)
        at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2057)
        at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1847)
        at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1802)
        at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1709)
        at androidx.fragment.app.FragmentManagerImpl.executePendingTransactions(FragmentManagerImpl.java:229)
        at fr.free.nrw.commons.bookmarks.BookmarksActivity.onItemClick(BookmarksActivity.java:96)
        at android.widget.AdapterView.performItemClick(AdapterView.java:330)
        at android.widget.AbsListView.performItemClick(AbsListView.java:1190)
        at android.widget.AbsListView$PerformClick.run(AbsListView.java:3198)
        at android.widget.AbsListView$3.run(AbsListView.java:4116)
        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:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Device and Android version:

Device name - Pixel 3a XL
Android version - Android 10
API level - 29

Commons app version:
2.12.3

Would you like to work on the issue?
yes

@nicolas-raoul
Copy link
Member

I confirm that this crash still happens in latest master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants