be more careful with returned table def for schema

This commit is contained in:
Evan Prodromou 2011-09-18 10:59:01 -04:00
parent 1040f1346c
commit 13e1fab919

View 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;
}
}
}