From: Evan Prodromou Date: Sun, 18 Sep 2011 14:59:01 +0000 (-0400) Subject: be more careful with returned table def for schema X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=13e1fab919bff215808e7d4670dacb5eb0450f19;p=quix0rs-gnu-social.git be more careful with returned table def for schema --- diff --git a/lib/schema.php b/lib/schema.php index aad705a533..0ac2255f16 100644 --- a/lib/schema.php +++ b/lib/schema.php @@ -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; + } } }