Browse Source

Fix notice.

mscherer 5 years ago
parent
commit
e9caa067e6
1 changed files with 3 additions and 2 deletions
  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'];