From 11845f26fc39eb4560c9a420f0c0c413e7ef96ad Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 30 Mar 2022 17:47:05 +0100 Subject: [PATCH] Fix ClassCastException. (#235) --- src/main/java/me/kavin/piped/utils/ResponseHelper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index c78dd00..16306f8 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -142,7 +142,10 @@ public class ResponseHelper { final List relatedStreams = new ObjectArrayList<>(); - info.getRelatedItems().forEach(o -> relatedStreams.add(collectRelatedStream(o))); + info.getRelatedItems().forEach(o -> { + if (o instanceof StreamInfoItem) + relatedStreams.add(collectRelatedStream(o)); + }); long time = info.getUploadDate() != null ? info.getUploadDate().offsetDateTime().toInstant().toEpochMilli() : System.currentTimeMillis();