diff --git a/scholartokens.module b/scholartokens.module index 4c20c52..aadfda2 100644 --- a/scholartokens.module +++ b/scholartokens.module @@ -75,6 +75,9 @@ function scholartokens_format_date($node) { $config = \Drupal::config('scholartokens.settings'); $field = $config->get('field'); $original = $node->get($field)->value; + if (!$original) { + return ''; + } $date_parts = explode('-', $original); if (count($date_parts) == 1) { $replacement = $date_parts[0];