Skip to content

Commit

Permalink
Merge pull request TeamNewPipe#10576 from AudricV/fix-npe-feed-new-it…
Browse files Browse the repository at this point in the history
…ems-button

Fix crash when setting the masking of the new feed items button if the context is null
  • Loading branch information
Stypox authored Nov 16, 2023
2 parents 3dc593f + 9fab0ec commit be4a5a5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,13 @@ class FeedFragment : BaseStateFragment<FeedState>() {
execOnEnd = {
// Disabled animations would result in immediately hiding the button
// after it showed up
if (DeviceUtils.hasAnimationsAnimatorDurationEnabled(context)) {
// Hide the new items-"popup" after 10s
hideNewItemsLoaded(true, 10000)
// Context can be null in some cases, so we have to make sure it is not null in
// order to avoid a NullPointerException
context?.let {
if (DeviceUtils.hasAnimationsAnimatorDurationEnabled(it)) {
// Hide the new items button after 10s
hideNewItemsLoaded(true, 10000)
}
}
}
)
Expand Down

0 comments on commit be4a5a5

Please sign in to comment.