- Issue created by @drupatz
In image_sizes.module this call causes a fatal:
Error: Call to a member function getBreakpointGroup() on null in image_sizes_theme_suggestions_responsive_image_formatter_alter() (line 80 of modules/contrib/image_sizes/image_sizes.module).
In my case, this one $responsive_image_style_storage->load($variables['responsive_image_style_id']);
returns null, because $variables['responsive_image_style_id']
is empty, as an original image is rendered.
Of course, we could avoid calling any image_sizes functionality, when not attempting to render an image derivative.
But as a method call on null should never happen, i think a sanity check prior to the call, is always a good way to avoid such errors. In my case, this would be sufficient.
As mentioned above, sth like
if (!($responsive_image_style instanceof ResponsiveImageStyleInterface)) {
return;
}
prior to the call would be sufficient, not only for my case, but for all others too.
Active
4.0
Code