From 004515aaee627a18590266327d58d117e506a2ed Mon Sep 17 00:00:00 2001 From: Ramesh Reddy Date: Mon, 17 Apr 2017 17:04:31 -0500 Subject: [PATCH] OLINGO-1112: checking the key values for null when building the location URL in the response --- .../apache/olingo/server/core/responses/EntityResponse.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java index 596c91a02..55008f997 100644 --- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java +++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java @@ -215,6 +215,10 @@ public class EntityResponse extends ServiceResponse { String propertyType = entity.getProperty(key).getType(); Object propertyValue = entity.getProperty(key).getValue(); + if (propertyValue == null) { + throw new EdmPrimitiveTypeException("The key value for property "+key+" is invalid; Key value cannot be null"); + } + if(propertyType.startsWith("Edm.")) { propertyType = propertyType.substring(4); }