Skip to content

Commit

Permalink
Return NULL value for Undefined
Browse files Browse the repository at this point in the history
Return a NULL value from the data object when no data is set in the XML
file
  • Loading branch information
Adam Greer committed Nov 26, 2015
1 parent 6e83e38 commit f60dfa5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/XeroPHP/Remote/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ public function fromStringArray($input_array, $replace_data = false) {
continue;
}

if(!isset($input_array[$property]))
if(!isset($input_array[$property])) {
$this->_data[$property] = null;
continue;
}

//Fix for an earlier assumption that the API didn't return more than two levels of nested objects.
//Handles Invoice > Contact > Address etc. in one build.
Expand Down

0 comments on commit f60dfa5

Please sign in to comment.