From 9fe9770714485c7beee03128f79ca9b08a47c7e4 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 18 Jul 2021 16:44:31 +0530 Subject: [PATCH] Fix NPE. --- src/main/java/me/kavin/piped/utils/ResponseHelper.java | 3 ++- 1 file changed, 2 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 1f26898..569eef3 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -165,7 +165,8 @@ public class ResponseHelper { info.getStreamSegments().forEach( segment -> segments.add(new ChapterSegment(segment.getTitle(), segment.getStartTimeSeconds()))); - long time = info.getUploadDate().offsetDateTime().toInstant().toEpochMilli(); + long time = info.getUploadDate() != null ? info.getUploadDate().offsetDateTime().toInstant().toEpochMilli() + : System.currentTimeMillis(); if (info.getUploadDate() != null && System.currentTimeMillis() - time < TimeUnit.DAYS.toMillis(10)) updateViews(info.getId(), info.getViewCount(), time, false);