Skip to content

Commit

Permalink
Add checks when response is null
Browse files Browse the repository at this point in the history
  • Loading branch information
heychazza committed Feb 19, 2023
1 parent decf576 commit 5bd7957
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ subprojects {
}

group = "net.analyse.plugin"
version = "1.1.12"
version = "1.1.13"

tasks {
shadowJar {
Expand Down
4 changes: 4 additions & 0 deletions sdk/src/main/java/net/analyse/sdk/AnalyseSDK.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ public String getLocationFromIP(String ipAddress) throws ServerNotFoundException
.withServerToken(this.token)
.send();

if(response == null) {
return null;
}

if(response.code() == 404) {
response.close();
throw new ServerNotFoundException();
Expand Down

0 comments on commit 5bd7957

Please sign in to comment.