浏览代码

Fix notice.

mscherer 5 年之前
父节点
当前提交
e9caa067e6
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/Model/Behavior/SluggedBehavior.php

+ 3 - 2
src/Model/Behavior/SluggedBehavior.php

@@ -130,8 +130,9 @@ class SluggedBehavior extends Behavior {
 	 */
 	public function initialize(array $config): void {
 		if ($this->_config['length'] === null) {
-			$length = $this->_table->getSchema()->getColumn($this->_config['field'])['length'];
-			$this->_config['length'] = $length ?: 0;
+			$field = $this->_table->getSchema()->getColumn($this->_config['field']);
+			$length = $field ? $field['length'] : 0;
+			$this->_config['length'] = $length ;
 		}
 
 		$label = $this->_config['label'] = (array)$this->_config['label'];