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

Null pointer exception: ProfileStatsWidget #462

Closed
wax911 opened this issue Dec 23, 2021 · 0 comments · Fixed by #469
Closed

Null pointer exception: ProfileStatsWidget #462

wax911 opened this issue Dec 23, 2021 · 0 comments · Fixed by #469
Assignees
Labels
bug Broken functionality
Milestone

Comments

@wax911
Copy link
Member

wax911 commented Dec 23, 2021

AniTrend Issue Guidelines

Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.

You may find an answer in already closed issues:
https://github.com/AniTrend/anitrend-app/issues?q=is%3Aissue+is%3Aclosed

Description Of Bug

Seems to be an crash caused an empty bundle param on lines: 153 & 160

case R.id.user_anime_total_container:
intent = new Intent(getContext(), MediaListActivity.class);
intent.putExtras(bundle);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(KeyUtil.arg_mediaType, KeyUtil.ANIME);
getContext().startActivity(intent);
break;
case R.id.user_manga_total_container:
intent = new Intent(getContext(), MediaListActivity.class);
intent.putExtras(bundle);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(KeyUtil.arg_mediaType, KeyUtil.MANGA);
getContext().startActivity(intent);
break;
}

Additional Context

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.unparcel()' on a null object reference
       at android.os.Bundle.putAll(Bundle.java:292)
       at android.content.Intent.putExtras(Intent.java:9537)
       at com.mxt.anitrend.base.custom.view.widget.ProfileStatsWidget.onClick(ProfileStatsWidget.java:160)
       at android.view.View.performClick(View.java:7188)
       at android.view.View.performClickInternal(View.java:7165)
       at android.view.View.access$3500(View.java:822)
       at android.view.View$PerformClick.run(View.java:27701)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:224)
       at android.app.ActivityThread.main(ActivityThread.java:7584)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
@wax911 wax911 added the bug Broken functionality label Dec 23, 2021
@wax911 wax911 added this to the 1.9.X milestone Dec 23, 2021
@wax911 wax911 self-assigned this Dec 23, 2021
@wax911 wax911 linked a pull request Dec 23, 2021 that will close this issue
10 tasks
luk1337 added a commit to luk1337/anitrend-app that referenced this issue Dec 23, 2021
This fixes a possible NPE in onClick() when user tries to go to anime /
manga list of any given user before the data has been fully loaded.

Closes: AniTrend#462
@wax911 wax911 linked a pull request Dec 23, 2021 that will close this issue
10 tasks
@wax911 wax911 closed this as completed in 8a4a7f8 Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken functionality
Projects
None yet
1 participant