Added the new versioning validation for policy and policy type
[policy/api.git] / main / src / main / java / org / onap / policy / api / main / rest / provider / CommonModelProvider.java
index fc0f436..4a49089 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================\r
  * ONAP Policy API\r
  * ================================================================================\r
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.\r
  * Modifications Copyright (C) 2019 Nordix Foundation.\r
  * ================================================================================\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
@@ -121,7 +121,8 @@ public class CommonModelProvider implements AutoCloseable {
      */\r
     protected <T> boolean hasData(Map<String, T> mapToCheck) {\r
 \r
-        return (mapToCheck != null && !mapToCheck.isEmpty());\r
+        // We don't allow a null or empty map as well as a map entry with a valid key but null value\r
+        return (mapToCheck != null && !mapToCheck.isEmpty() && !mapToCheck.containsValue(null));\r
     }\r
 \r
     /**\r