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

[FIX] RankStatsFragment ISE fix candidate #679

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Conversation

rksh
Copy link
Contributor

@rksh rksh commented Jan 23, 2024

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.

…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));
Copy link
Member

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)?

Copy link
Contributor Author

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) {
Copy link
Member

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 ?

Copy link
Contributor Author

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.

@rksh rksh merged commit c4dd61e into wiglenet:main Jan 24, 2024
1 check passed
Copy link
Member

@uhtu uhtu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rksh rksh deleted the toast_text_safety branch January 24, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants