Skip to content

Commit 54dd1ba

Browse files
committed
Fix crash when adding new url params to a request that started empty
1 parent b495b12 commit 54dd1ba

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=2.0.0
2-
mavendir=
1+
version=2.0.1
2+
mavendir=

src/main/java/com/creatubbles/api/core/CreatubblesRequest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.lang.reflect.Array;
44
import java.util.Arrays;
5-
import java.util.Collections;
65
import java.util.List;
76
import java.util.Map;
87
import java.util.concurrent.ExecutionException;
@@ -13,6 +12,7 @@
1312
import javax.ws.rs.core.Response;
1413

1514
import jersey.repackaged.com.google.common.base.Throwables;
15+
import jersey.repackaged.com.google.common.collect.Maps;
1616

1717
import org.glassfish.jersey.client.JerseyWebTarget;
1818
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
@@ -28,7 +28,7 @@ public abstract class CreatubblesRequest<T extends CreatubblesResponse> {
2828

2929
private String endPoint, acceptLanguage, data;
3030
private HttpMethod httpMethod;
31-
private Map<String, String> urlParameters;
31+
private final Map<String, String> urlParameters = Maps.newHashMap();
3232
private Response response;
3333
private Future<Response> futureResponse;
3434

@@ -55,9 +55,7 @@ public CreatubblesRequest(String endPoint, HttpMethod httpMethod, String accessT
5555
this.endPoint = endPoint;
5656
this.httpMethod = httpMethod;
5757
if (urlParameters != null) {
58-
this.urlParameters = urlParameters;
59-
} else {
60-
this.urlParameters = Collections.emptyMap();
58+
this.urlParameters.putAll(urlParameters);
6159
}
6260
this.accessToken = accessToken;
6361
}

0 commit comments

Comments
 (0)