diff --git a/lib/Everyman/Neo4j/Query/ResultSet.php b/lib/Everyman/Neo4j/Query/ResultSet.php index 062e3b0..ac9b428 100644 --- a/lib/Everyman/Neo4j/Query/ResultSet.php +++ b/lib/Everyman/Neo4j/Query/ResultSet.php @@ -50,10 +50,14 @@ public function offsetExists($offset) public function offsetGet($offset) { - if (!isset($this->rows[$offset])) { + if (! isset($this->rows[$offset])) { + if (isset($this->data[$offset])) { $this->rows[$offset] = new Row($this->client, $this->columns, $this->data[$offset]); + } else { + return null; + } } - return $this->rows[$offset]; + return $this->rows[$offset]; } public function offsetSet($offset, $value)