Repository: olingo-odata4
Updated Branches:
  refs/heads/master c85b6a623 -> 004515aae


OLINGO-1112: checking the key values for null when building the location URL in 
the response


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/004515aa
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/004515aa
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/004515aa

Branch: refs/heads/master
Commit: 004515aaee627a18590266327d58d117e506a2ed
Parents: c85b6a6
Author: Ramesh Reddy <[email protected]>
Authored: Mon Apr 17 17:04:31 2017 -0500
Committer: Ramesh Reddy <[email protected]>
Committed: Mon Apr 17 17:04:31 2017 -0500

----------------------------------------------------------------------
 .../org/apache/olingo/server/core/responses/EntityResponse.java  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/004515aa/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/EntityResponse.java
----------------------------------------------------------------------
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 596c91a..55008f9 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);
       }

Reply via email to