1+ /*
2+ * Copyright (C) 2026 Katsute <https://github.com/Katsute>
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; either version 2 of the License, or
7+ * (at your option) any later version.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License along
15+ * with this program; if not, write to the Free Software Foundation, Inc.,
16+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17+ */
18+
119package dev .katsute .civitai ;
220
321import java .io .BufferedReader ;
@@ -677,23 +695,23 @@ private final Map<String,String> map(final String... args){
677695 }
678696
679697 private final Response request (final String url ){
680- return request (url , "GET" , Map . of () );
698+ return request (url , "GET" , null );
681699 }
682700
683701 private final Response request (final String url , final Map <String ,String > params ){
684702 return request (url , "GET" , params );
685703 }
686704
687705 private final Response request (final String url , final String method ){
688- return request (url , method , Map . of () );
706+ return request (url , method , null );
689707 }
690708
691709 private final Response request (final String url , final String method , final Map <String ,String > params ){
692710 HttpURLConnection conn ;
693711 try {
694712 final String URL =
695713 url +
696- (params .isEmpty () ? "" : '?' +
714+ (params == null || params .isEmpty () ? "" : '?' +
697715 params
698716 .entrySet ()
699717 .stream ()
@@ -766,4 +784,4 @@ private Response handleResponseCodes(final ThrowableSupplier<Response,IOExceptio
766784 }
767785 }
768786
769- }
787+ }
0 commit comments