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

This commit is contained in:
Ramesh Reddy 2017-04-17 17:04:31 -05:00
parent c85b6a6239
commit 004515aaee
1 changed files with 4 additions and 0 deletions

View File

@ -215,6 +215,10 @@ public class EntityResponse extends ServiceResponse {
String propertyType = entity.getProperty(key).getType(); String propertyType = entity.getProperty(key).getType();
Object propertyValue = entity.getProperty(key).getValue(); 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.")) { if(propertyType.startsWith("Edm.")) {
propertyType = propertyType.substring(4); propertyType = propertyType.substring(4);
} }