From 50e5a8871ac9f938f765fde8d130c5aa447b61bf Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 2 Jun 2021 00:22:48 +0530 Subject: [PATCH] Fix error when playlist has no uploader. --- src/main/java/me/kavin/piped/utils/ResponseHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index 139ec13..29dd61f 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -263,9 +263,10 @@ public class ResponseHelper { } final Playlist playlist = new Playlist(info.getName(), rewriteURL(info.getThumbnailUrl()), - rewriteURL(info.getBannerUrl()), nextpage, body, info.getUploaderName(), - info.getUploaderUrl().substring(23), rewriteURL(info.getUploaderAvatarUrl()), - (int) info.getStreamCount(), relatedStreams); + rewriteURL(info.getBannerUrl()), nextpage, body, + info.getUploaderName().isEmpty() ? null : info.getUploaderName(), + info.getUploaderUrl().isEmpty() ? null : info.getUploaderUrl().substring(23), + rewriteURL(info.getUploaderAvatarUrl()), (int) info.getStreamCount(), relatedStreams); return Constants.mapper.writeValueAsBytes(playlist);