From 9e2a6ed238fb0457181f8a2bbb64c2be42113ddc Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Wed, 10 Sep 2014 17:22:01 +0100 Subject: [PATCH] If there are no scopes to format then just return an empty array --- src/Entity/AbstractTokenEntity.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Entity/AbstractTokenEntity.php b/src/Entity/AbstractTokenEntity.php index 4712f68d..d8d8af25 100644 --- a/src/Entity/AbstractTokenEntity.php +++ b/src/Entity/AbstractTokenEntity.php @@ -137,6 +137,10 @@ abstract class AbstractTokenEntity */ protected function formatScopes($unformatted = []) { + if (is_null($unformatted)) { + return []; + } + $scopes = []; foreach ($unformatted as $scope) { if ($scope instanceof ScopeEntity) {