From 8f816e70f0d22de1c5a5c1c9831e2bf5fd3df2ff Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 30 Oct 2015 12:23:49 +0530 Subject: [PATCH] quotatypes: fix NPE issue Signed-off-by: Rohit Yadav --- .../org/apache/cloudstack/quota/constant/QuotaTypes.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/quota/src/org/apache/cloudstack/quota/constant/QuotaTypes.java b/framework/quota/src/org/apache/cloudstack/quota/constant/QuotaTypes.java index 50ecd813fe2..36910f47741 100644 --- a/framework/quota/src/org/apache/cloudstack/quota/constant/QuotaTypes.java +++ b/framework/quota/src/org/apache/cloudstack/quota/constant/QuotaTypes.java @@ -94,6 +94,10 @@ public class QuotaTypes extends UsageTypes { } static public String getDescription(int quotaType) { - return quotaTypeMap.get(quotaType).getDescription(); + QuotaTypes t = quotaTypeMap.get(quotaType); + if (t != null) { + return t.getDescription(); + } + return null; } }