Newpipe: Popup Player fails to launch on empty playlist

Created on 15 Apr 2020  ยท  11Comments  ยท  Source: TeamNewPipe/NewPipe

Version

  • v0.19.2 (F-Droid release)

Steps to reproduce the bug

  • Pick any of your own playlists.
  • Make sure it contains one or more videos.
  • Clear the playlist by long-pressing on each video โ†’ "Delete".
  • Once your playlist is empty, repeatedly tap on "Popup" (you must quickly double-tap the "Popup" button!).
  • Expected behavior


    Nothing should ever happen.
    The app must not invoke the popup player unless there are actually some items in that playlist.

    Actual behaviour


    Newpipe raises a NullPointerException, because ExoPlayer was called on a null object reference (โ† empty playlist).

    Additional note: If you don't encounter any issues, please follow the instructions again and make sure your playlist initially contains one or more videos. Then clear the playlist. If you call the popup player on a playlist that was already empty before, it won't raise that exception.

    Screenshots/Screen recordings


    N/A

    Logs

    Exception

    • __User Action:__ ui error
    • __Request:__ App crash, UI failure
    • __Content Language:__ GB
    • __Service:__ none
    • __Version:__ 0.19.2
    • __OS:__ Linux Android 10 - 29

    Crash log

    java.lang.RuntimeException: Unable to start service org.schabi.newpipe.player.PopupVideoPlayer@95832d8 with Intent { cmp=org.schabi.newpipe/.player.PopupVideoPlayer (has extras) }: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.exoplayer2.SimpleExoPlayer org.schabi.newpipe.player.BasePlayer.getPlayer()' on a null object reference
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4434)
        at android.app.ActivityThread.access$2100(ActivityThread.java:272)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8016)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.exoplayer2.SimpleExoPlayer org.schabi.newpipe.player.BasePlayer.getPlayer()' on a null object reference
        at org.schabi.newpipe.player.PopupVideoPlayer.onStartCommand(PopupVideoPlayer.java:161)
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4416)
        ... 8 more
    java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.exoplayer2.SimpleExoPlayer org.schabi.newpipe.player.BasePlayer.getPlayer()' on a null object reference
        at org.schabi.newpipe.player.PopupVideoPlayer.onStartCommand(PopupVideoPlayer.java:161)
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4416)
        at android.app.ActivityThread.access$2100(ActivityThread.java:272)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8016)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
    
    



    bug more info needed player

    All 11 comments

    Newpipe raises a NullPointerException, because ExoPlayer was called on a null object reference (โ† empty playlist).

    That's not the case I think. The problem has to do with continuous popup generation, that uses some resources and then cleans them up, and this is probably the result of the cleaning up of a player while another one was starting.

    That's right! I checked upon the "continuous popup generation" and found out that the same exception occurs when you open a video in popup mode, drag the floating player to the close button, then quickly tap "Popup" once again. You'd see the icon in the notification bar which indicates that the current player isn't fully closed yet, and if you're quick enough to launch a new popup player, it will cause the app to crash. @Stypox

    I think this is part of a general Android-wide problem that double tapping opens two fragments. I don't know _why_ Google hasn't fixed this yet. You can double tap on practically _anything_ and it'll open two (even three if you're fast enough) fragments, which you can see when you back out. Try it in the Settings app.

    If Newpipe is able to override this generic Android behaviour, a lot of these kinds of problems wouldn't occur.

    @opusforlife2: I've never seen that double tapping behavior

    ... maybe its on LOS only? But then it's been on 14, 15 _and_ 16.

    @opusforlife2: I just tested it on my old phone that I put Resurrection Remix OS on, and there that's indeed the case. Interestingโ€ฆ

    Could you file a technical sort of bug report? The Lineage guys tend to ignore everything that isn't _exactly_ to their specifications.

    Does this apk, containing the features that will be in 0.20.0, fix the issue?

    Yes, it's been fixed in this build!

    Off-topic, however if I attempt to clear a playlist by deleting each video and then tap "Play All", it causes another exception:

    Exception

    • __User Action:__ ui error
    • __Request:__ App crash, UI failure
    • __Content Country:__ US
    • __Content Language:__ en-US
    • __App Language:__ en_US
    • __Service:__ none
    • __Version:__ 0.19.8
    • __OS:__ Linux Android 10 - 29
      Crash log

    java.lang.NullPointerException: Attempt to invoke virtual method 'int org.schabi.newpipe.player.playqueue.PlayQueueItem.getServiceId()' on a null object reference
        at org.schabi.newpipe.util.NavigationHelper.playOnMainPlayer(NavigationHelper.java:143)
        at org.schabi.newpipe.util.NavigationHelper.playOnMainPlayer(NavigationHelper.java:134)
        at org.schabi.newpipe.local.playlist.LocalPlaylistFragment.lambda$handleResult$6$LocalPlaylistFragment(LocalPlaylistFragment.java:495)
        at org.schabi.newpipe.local.playlist.-$$Lambda$LocalPlaylistFragment$7rqcGcBUyCC9XZFxfJJ-WkpVVzc.onClick(Unknown Source:2)
        at android.view.View.performClick(View.java:7862)
        at android.view.View.performClickInternal(View.java:7831)
        at android.view.View.access$3600(View.java:879)
        at android.view.View$PerformClick.run(View.java:29359)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8167)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
    
    



    Should we file a separate bug report for this or can we discuss it in this thread?

    @HugeFrog24 create a new issue and follow all of the steps in the template, thank you!

    @HugeFrog24 see #4546 and maybe paste it there i guess!!?

    Was this page helpful?
    0 / 5 - 0 ratings

    Related issues

    B0pol picture B0pol  ยท  3Comments

    PanderMusubi picture PanderMusubi  ยท  3Comments

    ghost picture ghost  ยท  3Comments

    probonopd picture probonopd  ยท  3Comments

    danialbehzadi picture danialbehzadi  ยท  3Comments