salesforce-marketingcloud / FuelSDK-Java

Salesforce Marketing Cloud Java SDK
BSD 3-Clause "New" or "Revised" License
73 stars 122 forks source link

Calling retrieveObject in ETClient with filter that produces no results causes NullPointerException #18

Closed jasonbuchanan closed 9 years ago

jasonbuchanan commented 9 years ago

When calling retrieveObject in ETClient with a filter that produces no results, i.e. the key doesn't exist, the individualResults field in ETResponse is empty so the condition if( individualResults.size() == 0) passes and null is returned for getResult(). The call of getResult().getObject() in ETResponse's getObject method then causes a NullPointerException.

The response should be checked for null condition, and if it is null, return null as the result object.