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 crash when setting the masking of the new feed items button if the context is null #10576

Merged
merged 1 commit into from Nov 16, 2023

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented Nov 15, 2023

What is it?

  • Bugfix (user facing)

Description of the changes in your PR

This PR fixes a crash when setting the masking of the new feed items button if the feed fragment context is null (see the Javadoc of Fragment.getContext()).

It makes sure that the context is not null before calling DeviceUtils.hasAnimationsAnimatorDurationEnabled.

If the context is null, the button will now not be hidden automatically instead of crashing the app.

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@AudricV AudricV added bug Issue is related to a bug feed Issue is related to the feed labels Nov 15, 2023
…e context is null

As the fragment context can be null in some cases, we have to make sure that
the context is not null before calling
DeviceUtils.hasAnimationsAnimatorDurationEnabled.

If the context is null, the button will now not be hidden automatically.
@AudricV AudricV force-pushed the fix-npe-feed-new-items-button branch from 1b14c2b to 9fab0ec Compare November 15, 2023 18:05
Copy link

sonarcloud bot commented Nov 15, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Stypox Stypox merged commit be4a5a5 into TeamNewPipe:dev Nov 16, 2023
8 of 9 checks passed
@AudricV AudricV deleted the fix-npe-feed-new-items-button branch November 16, 2023 08:23
@Stypox Stypox mentioned this pull request Nov 16, 2023
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug feed Issue is related to the feed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App Crash II
2 participants