]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
be more careful with returned table def for schema
authorEvan Prodromou <evan@status.net>
Sun, 18 Sep 2011 14:59:01 +0000 (10:59 -0400)
committerEvan Prodromou <evan@status.net>
Sun, 18 Sep 2011 14:59:01 +0000 (10:59 -0400)
lib/schema.php

index aad705a533a489086a7a1567f32539a93bfc9d32..0ac2255f16a09bb1806111e06659b1b35fd75448 100644 (file)
@@ -107,9 +107,11 @@ class Schema
     {
         $td = $this->getTableDef($table);
 
-        foreach ($td->columns as $cd) {
-            if ($cd->name == $column) {
-                return $cd;
+        if (!empty($td) && !empty($td->columns)) {
+            foreach ($td->columns as $cd) {
+                if ($cd->name == $column) {
+                    return $cd;
+                }
             }
         }