summaryrefslogtreecommitdiffstats
path: root/controller-server/src
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2020-11-18 18:07:04 +0100
committerØyvind Grønnesby <oyving@verizonmedia.com>2020-11-18 18:07:04 +0100
commit55797a758b386726903cfeace94af9706e3fe3be (patch)
tree21453c4add310237233ffb337d12b3600476d169 /controller-server/src
parent6b0237fcb35de3d74ca3c362cddfe3cdfde77a23 (diff)
Handle nullness in renderCurrentUsage
If there is no usage here the map entry will be null. Just skip rendering if that is the case.
Diffstat (limited to 'controller-server/src')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandler.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandler.java
index 8b0c2febe46..d6c6f5ff167 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandler.java
@@ -308,6 +308,7 @@ public class BillingApiHandler extends LoggingRequestHandler {
}
private void renderCurrentUsage(Cursor cursor, Invoice currentUsage) {
+ if (currentUsage == null) return;
cursor.setString("amount", currentUsage.sum().toPlainString());
cursor.setString("status", "accrued");
cursor.setString("from", currentUsage.getStartTime().format(DATE_TIME_FORMATTER));