polymorphicshade / NewPipe

A fork of NewPipe with SponsorBlock functionality.
GNU General Public License v3.0
3.23k stars 106 forks source link

fix DownloadDialog crash if there are no streams available yet #356

Open evermind-zz opened 11 months ago

evermind-zz commented 11 months ago

If there are no streams the DownloadDialog will close again quickly, but the rxJava job fetching the VideoSegments is still going. This patch fixes that:

What is it?

Description of the changes in your PR

fix DownloadDialog crash if there are now streams available yet

If there are no streams the DownloadDialog will close again quickly,
but the rxJava job fetching the VideoSegments is still going. This patch
fixes that:
- move initialization of getting VideoSegments rxJava job until after initToolbar()
- have Disposable for the VideoSegments stuff that will be disposed if the
  DownloadDialog will be destroyed.

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence