diff --git a/dibi/libs/DibiDatabaseInfo.php b/dibi/libs/DibiDatabaseInfo.php index 9350f93f..4d8a7b41 100644 --- a/dibi/libs/DibiDatabaseInfo.php +++ b/dibi/libs/DibiDatabaseInfo.php @@ -533,7 +533,7 @@ class DibiColumnInfo extends DibiObject if (self::$types === NULL) { self::$types = new DibiLazyStorage(array(__CLASS__, 'detectType')); } - return self::$types->{$this->info['nativetype']}; + return $this->info['nativetype'] ? self::$types->{$this->info['nativetype']} : dibi::TEXT; } diff --git a/dibi/libs/DibiLazyStorage.php b/dibi/libs/DibiLazyStorage.php index ffccb398..33b24da2 100644 --- a/dibi/libs/DibiLazyStorage.php +++ b/dibi/libs/DibiLazyStorage.php @@ -59,6 +59,9 @@ final class DibiLazyStorage extends DibiLazyStorageBase if (is_array($nm)) { // preg_replace_callback support $nm = $nm[1]; } + if ($nm == '') { + throw new InvalidStateException('Missing identifier name.'); + } return $this->$nm = call_user_func($this->getCallback(), $nm); }