From 7b26d0f2ee0dc1889ad525069ad1829c87f50117 Mon Sep 17 00:00:00 2001 From: Olaniyan Folajimi Date: Tue, 6 May 2025 09:37:40 +0100 Subject: [PATCH] fix: http status null check --- pom.xml | 2 +- src/main/java/org/hisp/dhis/response/Response.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ca1987fb..20bbd548 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.hisp dhis2-java-client - 2.2.0 + 2.2.1-SNAPSHOT jar DHIS 2 API client for Java diff --git a/src/main/java/org/hisp/dhis/response/Response.java b/src/main/java/org/hisp/dhis/response/Response.java index 4607d1d7..9a4eee63 100644 --- a/src/main/java/org/hisp/dhis/response/Response.java +++ b/src/main/java/org/hisp/dhis/response/Response.java @@ -68,7 +68,11 @@ public Response(Status status, Integer httpStatusCode, String message, String er } public HttpStatus getHttpStatus() { - return HttpStatus.valueOf(httpStatusCode); + if (httpStatusCode != null){ + return HttpStatus.valueOf(httpStatusCode); + } + + return HttpStatus.UNKNOWN_REASON_0; } /**