Merge pull request #4232 from ByteHamster/fix-crash-loading-chapters

Fixed crash when loading chapters fails
This commit is contained in:
H. Lehmann 2020-06-14 19:49:11 +02:00 committed by GitHub
commit 51e17214f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -311,12 +311,13 @@ public class PlaybackServiceTaskManager {
if (media.getChapters() == null) {
Completable.create(emitter -> {
media.loadChapterMarks();
emitter.onComplete();
})
media.loadChapterMarks();
emitter.onComplete();
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(() -> callback.onChapterLoaded(media));
.subscribe(() -> callback.onChapterLoaded(media),
throwable -> Log.d(TAG, "Error loading chapters: " + Log.getStackTraceString(throwable)));
}
}