Skip to content

Commit

Permalink
Check that content type is set before use.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Sep 19, 2023
1 parent 68fd92d commit f8462bc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function setPostFlags(&$post)
$post->showDate = in_array('date', $this->data['posts_fields']);
$post->attributeList = !empty($post->attributeList) ? $post->attributeList : [];

if ('event' == $post->contentType) {
if (isset($post->contentType) && 'event' == $post->contentType) {
$post->showDate = true;
$eventOccasions = get_post_meta($post->id, 'occasions_complete', true);
if (!empty($eventOccasions)) {
Expand Down

0 comments on commit f8462bc

Please sign in to comment.