We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3dc593f + 9fab0ec commit be4a5a5Copy full SHA for be4a5a5
1 file changed
app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt
@@ -607,9 +607,13 @@ class FeedFragment : BaseStateFragment<FeedState>() {
607
execOnEnd = {
608
// Disabled animations would result in immediately hiding the button
609
// after it showed up
610
- if (DeviceUtils.hasAnimationsAnimatorDurationEnabled(context)) {
611
- // Hide the new items-"popup" after 10s
612
- 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 {
613
+ if (DeviceUtils.hasAnimationsAnimatorDurationEnabled(it)) {
614
+ // Hide the new items button after 10s
615
+ hideNewItemsLoaded(true, 10000)
616
+ }
617
}
618
619
)
0 commit comments