fix
authorMichael Wallner <mike@php.net>
Sat, 9 Mar 2013 22:17:58 +0000 (23:17 +0100)
committerMichael Wallner <mike@php.net>
Sat, 9 Mar 2013 22:21:45 +0000 (23:21 +0100)
lib/pq/Gateway/Row.php
lib/pq/Gateway/Rowset.php

index 0a2820aa612b5462fd537a214d0c3bff63ef4e83..e408430c736293fa3750ce810f31600500db1169 100644 (file)
@@ -130,7 +130,7 @@ class Row implements \JsonSerializable
         */
        function __get($p) {
                if (!isset($this->cell[$p])) {
-                       $this->cell[$p] = new Cell($this, $p, $this->data[$p]);
+                       $this->cell[$p] = new Cell($this, $p, isset($this->data[$p]) ? $this->data[$p] : null);
                }
                return $this->cell[$p];
        }
index 7c0a3c23395f56428d9c1506dfdc5f86ef089459..c0a337088ee6da3391c3ca53d6326367ec1692c4 100644 (file)
@@ -206,7 +206,7 @@ class Rowset implements \SeekableIterator, \Countable, \JsonSerializable
         */
        function current() {
                if (!$this->valid()) {
-                       throw new OutOfBoundsException("Invalid row index {$this->index}");
+                       throw new \OutOfBoundsException("Invalid row index {$this->index}");
                }
                return $this->rows[$this->index];
        }