diff --git a/token.module b/token.module index 22a938e..06ddae1 100644 --- a/token.module +++ b/token.module @@ -207,7 +207,7 @@ function token_entity_view_display_alter(EntityViewDisplayInterface $entity_disp // If the token view mode fell back to the 'default' view mode, then // use the default token formatter. - if (!$view_display->status()) { + if (!empty($view_display) && !$view_display->status()) { $fileTypeManager = \Drupal::service('plugin.manager.field.field_type'); $formatterManager = \Drupal::service('plugin.manager.field.formatter');