From 95353ca6730c044e9c4dac322b5a9d0b46b15db6 Mon Sep 17 00:00:00 2001 From: Stefan Schueller Date: Sun, 30 Aug 2020 15:52:27 +0200 Subject: [PATCH] Fix crashes when invalid URL is provided --- .../peertube/activity/VideoListActivity.java | 6 ++- .../peertube/service/VideoPlayerService.java | 46 ++++++++++++------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java index b00bfa5..868aba4 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java @@ -59,6 +59,7 @@ import com.mikepenz.iconics.IconicsDrawable; import net.schueller.peertube.R; import net.schueller.peertube.adapter.VideoAdapter; import net.schueller.peertube.helper.APIUrlHelper; +import net.schueller.peertube.model.Video; import net.schueller.peertube.model.VideoList; import net.schueller.peertube.network.GetUserService; import net.schueller.peertube.network.GetVideoDataService; @@ -348,7 +349,10 @@ public class VideoListActivity extends CommonActivity { } if (response.body() != null) { - videoAdapter.setData(response.body().getVideoArrayList()); + ArrayList