diff --git a/extensions/DatatypeTrait.php b/extensions/DatatypeTrait.php index 7d5359f..cf48489 100644 --- a/extensions/DatatypeTrait.php +++ b/extensions/DatatypeTrait.php @@ -74,12 +74,17 @@ trait DatatypeTrait { * * @access public * + * @uses getDatatypeFromString + * * @return array|bool */ public function getDatatypes() { if (empty($this->data)) { $this->data = $this->parse_string(); } + if (!is_array($this->data)) { + throw new \Exception('No data set yet.'); + } $result = []; foreach ($this->titles as $cName) {