diff --git a/token.tokens.inc b/token.tokens.inc index 1ca5bde..90fcaa0 100644 --- a/token.tokens.inc +++ b/token.tokens.inc @@ -1318,12 +1318,7 @@ function field_token_info_alter(&$info) { // Make sure a token type exists for this entity. $token_type = \Drupal::service('token.entity_mapper')->getTokenTypeForEntityType($entity_type_id); - if (empty($token_type)) { - continue; - } - - // Ensure the token type exists. - if (!isset($info['types'][$token_type])) { + if (empty($token_type) || !isset($info['types'][$token_type])) { continue; }