feelfreelinux / WykopMobilny

Unofficial wykop.pl client for Android
MIT License
161 stars 49 forks source link

Fix NPE if youtube url is not a video url. #182

Closed NieKam closed 5 years ago

NieKam commented 5 years ago

App crashes if YT url is a link to the channel. Before extracting ID and opening player, app must check if given URL is a video url.

Crash stack trace:

com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.NullPointerException: Video ID must not be null
        at io.github.feelfreelinux.wykopmobilny.ui.modules.embedview.YTPlayer.initialize(YTPlayer.kt:147)
        at io.github.feelfreelinux.wykopmobilny.ui.modules.embedview.YTPlayer.onCreate(YTPlayer.kt:119)

Video with test

feelfreelinux commented 5 years ago

Thanks for your contribution!