diff --git a/CHANGELOG.md b/CHANGELOG.md index c672f2c..0262513 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ Changelog ========= ## Unreleased ### Fixed +- Error when passed attempting to set types on an organization with a null value - Removing user from organization was causing an error -- Fix organization type urls on listing page and handle slug on detail page +- Organization type urls on listing page and handle slug on detail page ## 1.0.0-rc.11 - 2018-05-17 ### Fixed diff --git a/src/elements/traits/TypesAttribute.php b/src/elements/traits/TypesAttribute.php index a2cb1af..d58b2fc 100644 --- a/src/elements/traits/TypesAttribute.php +++ b/src/elements/traits/TypesAttribute.php @@ -134,7 +134,15 @@ public function setTypes($types) // Remove all types $this->types->setCachedResult([]); - return $this->addTypes($types); + if (!empty($types)) { + if (!is_array($types)) { + $types = [$types]; + } + + $this->addTypes($types); + } + + return $this; } /**