From fdbeffaf37bfc2cabec9b4443b6b6f86cbd46185 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 20 Nov 2023 06:09:26 +0000 Subject: [PATCH] Fix null qstring. --- .../java/me/kavin/piped/utils/URLUtils.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/URLUtils.java b/src/main/java/me/kavin/piped/utils/URLUtils.java index 6ec5b14..72e69d4 100644 --- a/src/main/java/me/kavin/piped/utils/URLUtils.java +++ b/src/main/java/me/kavin/piped/utils/URLUtils.java @@ -135,18 +135,16 @@ public class URLUtils { StringBuilder qstring = null; - if (hasQuery) { - for (List pair : queryPairs) { - if (qstring == null) { - qstring = new StringBuilder(); - } else { - qstring.append("&"); - } - - qstring.append(pair.get(0)); - qstring.append("="); - qstring.append(pair.get(1)); + for (List pair : queryPairs) { + if (qstring == null) { + qstring = new StringBuilder(); + } else { + qstring.append("&"); } + + qstring.append(pair.get(0)); + qstring.append("="); + qstring.append(pair.get(1)); } newUrl += "?" + qstring;