-
Notifications
You must be signed in to change notification settings - Fork 213
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
[FIX] RankStatsFragment ISE fix candidate #679
Conversation
…s in RankStatsFragment which makes this feel a little bit like overkill.
@@ -526,15 +530,15 @@ public void handleDialog(final int dialogId) { | |||
if (!exportM8bFile()) { | |||
Logging.warn("Failed to export m8b."); | |||
WiGLEToast.showOverFragment(getActivity(), R.string.error_general, | |||
getString(R.string.m8b_failed)); | |||
getActivity().getResources().getString(R.string.m8b_failed)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason to be more confident about this getActivity not returning null (contra :466)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a good one.
@@ -126,7 +126,10 @@ public void onAuthenticationRequired() { | |||
public void onTaskCompleted() { | |||
stopAnimation(); | |||
if (userDownloadFailed) { | |||
WiGLEToast.showOverFragment(a, R.string.upload_failed, getString(R.string.dl_failed)); | |||
if (null != a) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think a was already nullchecked at :113 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quite right - I was being cautious because it's in a callback, but the reference is final, it'll be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
here's a pass at making all these safe. the only reported exception is in RankStatsFragment which makes this feel a little bit like overkill, but there's reason to believe we're taking this risk in multiple places.