Skip to content

Commit

Permalink
Fix NPE when VPOS_ENVIRONMENT variable is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
hkakutalua committed Apr 12, 2021
1 parent 44e9a57 commit 4c27342
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/ao/vpos/vpos/Vpos.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public Vpos() {
this.refundCallbackUrl = System.getenv("REFUND_CALLBACK_URL");

try {
if (System.getenv("VPOS_ENVIRONMENT").equalsIgnoreCase("prd")) {
String environmentValue = System.getenv("VPOS_ENVIRONMENT");
if (environmentValue != null &&
environmentValue.equalsIgnoreCase("prd")) {
this.baseUrl = new URL(PRODUCTION_BASE_URL);
} else {
this.baseUrl = new URL(SANDBOX_BASE_URL);
Expand Down

0 comments on commit 4c27342

Please sign in to comment.