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

NullPointerException when enqueueing from sparse feed #9609

Open
6 tasks done
ktprograms opened this issue Dec 31, 2022 · 1 comment
Open
6 tasks done

NullPointerException when enqueueing from sparse feed #9609

ktprograms opened this issue Dec 31, 2022 · 1 comment
Labels
bug Issue is related to a bug feed Issue is related to the feed

Comments

@ktprograms
Copy link
Contributor

ktprograms commented Dec 31, 2022

Checklist

  • I am able to reproduce the bug with the latest version.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected version

0.24.1

Steps to reproduce the bug

In a subscription feed with "fast loading" enabled (where feed items from YouTube are "sparse"), have some videos playing, then enqueue one or more sparse items.
This only happens sometimes, and I'm not sure what causes it to happen/not happen sometimes.

Expected behavior

No crash

Actual behavior

Crash

(sorry about these short answers, what else is expected from a NullPointerException?)

Screenshots/Screen recordings

No response

Logs

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: GB
  • Content Language: en-GB
  • App Language: en_GB
  • Service: none
  • Version: 0.24.1
  • OS: Linux Android 12 - 31
Crash log

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
	at android.widget.Toast.makeText(Toast.java:892)
	at org.schabi.newpipe.util.NavigationHelper.enqueueOnPlayer(NavigationHelper.java:186)
	at org.schabi.newpipe.util.NavigationHelper.enqueueOnPlayer(NavigationHelper.java:200)
	at org.schabi.newpipe.info_list.dialog.StreamDialogDefaultEntry.lambda$static$2(StreamDialogDefaultEntry.java:54)
	at org.schabi.newpipe.info_list.dialog.StreamDialogDefaultEntry.$r8$lambda$HrNW3ftQD3NQNetYZjrz1JDwzD4(Unknown Source:0)
	at org.schabi.newpipe.info_list.dialog.StreamDialogDefaultEntry$$ExternalSyntheticLambda15.accept(Unknown Source:4)
	at org.schabi.newpipe.util.SparseItemUtil.lambda$fetchItemInfoIfSparse$0(SparseItemUtil.java:60)
	at org.schabi.newpipe.util.SparseItemUtil.$r8$lambda$rd2kSpgtBScfiwrztd_5JrCbEyQ(Unknown Source:0)
	at org.schabi.newpipe.util.SparseItemUtil$$ExternalSyntheticLambda2.accept(Unknown Source:4)
	at org.schabi.newpipe.util.SparseItemUtil.lambda$fetchStreamInfoAndSaveToDatabase$4(SparseItemUtil.java:121)
	at org.schabi.newpipe.util.SparseItemUtil.$r8$lambda$cfmnXoy0qdCzt8EeO-smvalxWsM(Unknown Source:0)
	at org.schabi.newpipe.util.SparseItemUtil$$ExternalSyntheticLambda0.accept(Unknown Source:6)
	at io.reactivex.rxjava3.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:62)
	at io.reactivex.rxjava3.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:81)
	at io.reactivex.rxjava3.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:123)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8669)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Affected Android/Custom ROM version

Android 12 (Samsung OneUI 4.1)

Affected device model

Samsung Galaxy A23

Additional information

No response

@ktprograms ktprograms added bug Issue is related to a bug needs triage Issue is not yet ready for PR authors to take up labels Dec 31, 2022
@ktprograms
Copy link
Contributor Author

I did some looking based on the crash log, it seems to be because at StreamDialogDefaultEntry.java:53, fragment.requireContext() isn't null so it successfully fetches, but then somehow in the callback at line 54 fragment.getContext() is null.

@opusforlife2 opusforlife2 added feed Issue is related to the feed and removed needs triage Issue is not yet ready for PR authors to take up labels Dec 31, 2022
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

No branches or pull requests

2 participants