From 13e1fab919bff215808e7d4670dacb5eb0450f19 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 18 Sep 2011 10:59:01 -0400 Subject: [PATCH] be more careful with returned table def for schema --- lib/schema.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; + } } } -- 2.39.5