From 6641ddc043e2fdf80bf733f0045187a5ede5b025 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:16:47 +0530 Subject: [PATCH] Add null-check for logging exceptions. --- src/main/java/me/kavin/piped/ServerLauncher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/kavin/piped/ServerLauncher.java b/src/main/java/me/kavin/piped/ServerLauncher.java index d3be310..8f96933 100644 --- a/src/main/java/me/kavin/piped/ServerLauncher.java +++ b/src/main/java/me/kavin/piped/ServerLauncher.java @@ -289,7 +289,7 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher { private @NotNull HttpResponse getErrorResponse(Exception e) { - if (e instanceof ExecutionException) + if (e.getCause() != null && e instanceof ExecutionException) e = (Exception) e.getCause(); if (!(e instanceof AgeRestrictedContentException || e instanceof ContentNotAvailableException))