Skip to content

Commit

Permalink
utils: return null if urlString is null or empty (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
crinklywrappr authored Jul 19, 2023
1 parent 9b4ca41 commit 97ca6ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/main/java/growthbook/sdk/java/GrowthBookUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ public static ArrayList<Float> getEqualWeights(Integer numberOfVariations) {
*/
@Nullable
public static Integer getQueryStringOverride(String id, String urlString, Integer numberOfVariations) {
if (urlString == null || urlString.isEmpty()) {
return null;
}
try {
URL url = new URL(urlString);
return getQueryStringOverride(id, url, numberOfVariations);
Expand Down

0 comments on commit 97ca6ab

Please sign in to comment.