Skip to content

[Bug]: Edit Category Crashes when Previous Button is Clicked #5505

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

Closed
shashankiitbhu opened this issue Feb 2, 2024 · 4 comments · Fixed by #5510
Closed

[Bug]: Edit Category Crashes when Previous Button is Clicked #5505

shashankiitbhu opened this issue Feb 2, 2024 · 4 comments · Fixed by #5510
Labels

Comments

@shashankiitbhu
Copy link
Contributor

Summary

App Crashes When You click Previous Button in Edit Category Activity In Your Contribution

Steps to reproduce

  1. Open the App
  2. Select any one of your contributions
  3. Click on the Edit Icon in the Category
  4. Click Previous Button

Expected behaviour

App Should go back to the previous page

Actual behaviour

App Crashes

Device name

Xaomi 11 Lite NE

Android version

Android 13

Commons app version

4.2.1-debug-main

Device logs

No response

Screen-shots

WhatsApp.Video.2024-02-02.at.11.16.16.PM.mp4

Would you like to work on the issue?

Yes

@psh
Copy link
Collaborator

psh commented Feb 3, 2024

The stacktrace associatedf with this crash -

java.lang.NullPointerException: Attempt to invoke virtual method 'void fr.free.nrw.commons.upload.categories.UploadCategoryAdapter.setItems(java.util.List)' on a null object reference
  at fr.free.nrw.commons.upload.categories.UploadCategoriesFragment.onPreviousButtonClicked(UploadCategoriesFragment.java:311)
  at fr.free.nrw.commons.upload.categories.UploadCategoriesFragment_ViewBinding$2.doClick(UploadCategoriesFragment_ViewBinding.java:55)
  at butterknife.internal.DebouncingOnClickListener.onClick(DebouncingOnClickListener.java:18)
  at android.view.View.performClick(View.java:7506)
  at android.view.View.performClickInternal(View.java:7483)
  at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
  at android.view.View$PerformClick.run(View.java:29334)
  at android.os.Handler.handleCallback(Handler.java:942)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loopOnce(Looper.java:201)
  at android.os.Looper.loop(Looper.java:288)
  at android.app.ActivityThread.main(ActivityThread.java:7872)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

from a line of code that says

    adapter.setItems(null);

The adapter is null maybe because was never setup?

@rohit9625
Copy link
Contributor

This behavior is the same as editing depiction fragments which is solved now.

@shashankiitbhu
Copy link
Contributor Author

shashankiitbhu commented Feb 4, 2024

But this particular issue is still not solved, I am looking into this issue . If this particular issue is solved then you can mention that issue's number @rohit9625

@shashankiitbhu
Copy link
Contributor Author

@psh yes init() is not getting called due to an incorrectly placed check

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

Successfully merging a pull request may close this issue.

3 participants