Skip to content

Commit

Permalink
added null-check to prevent crashing on incomplete fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbuis committed Apr 26, 2017
1 parent abaa46d commit 6f8786f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Field/FlexibleContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function fetchFields($fieldName, Builder $builder)
$post = $this->post->ID != $meta->post_id ? $this->post->find($meta->post_id) : $this->post;
$field = FieldFactory::make($meta->meta_key, $post);

if (!array_key_exists($id, $blocks)) {
if ($field === null || !array_key_exists($id, $blocks)) {
continue;
}

Expand Down

0 comments on commit 6f8786f

Please sign in to comment.