Skip to content

Commit

Permalink
Merge pull request #56 from digirati-co-uk/feature/fix-for-null-image…
Browse files Browse the repository at this point in the history
…styles

Fix for null image style objects.
  • Loading branch information
giorgiosironi authored Jan 16, 2017
2 parents 80a0d0b + bf377a7 commit b8bbdf9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ protected function processFieldImage(FieldItemListInterface $data, $required = F
str_replace(':', 'x', $ar),
$width . 'x' . $height,
];
$image[$type]['sizes'][$ar][$width] = ImageStyle::load(implode('_', $image_style))->buildUrl($image_uri);
$loaded_style = ImageStyle::load(implode('_', $image_style));
if ($loaded_style && $image_uri) {
$image[$type]['sizes'][$ar][$width] = $loaded_style->buildUrl($image_uri);
}
}
}
}
Expand Down

0 comments on commit b8bbdf9

Please sign in to comment.