resposniveimage: php 8 compat fix for themes without breakpoints

This commit is contained in:
onli 2021-05-30 12:04:16 +02:00
parent 20de7bd442
commit 50ccdce46c

View File

@ -86,7 +86,7 @@ class serendipity_event_responsiveimages extends serendipity_event
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init(); // if not set to avoid member function assign() on a non-object error, start Smarty templating
}
$this->breakpoints = $serendipity['smarty']->getTemplateVars('template_option')['breakpoints'];
$this->breakpoints = $serendipity['smarty']->getTemplateVars('template_option')['breakpoints'] ?? false;
if (! $this->breakpoints) {
$this->breakpoints = [1600, 1200, 600]; # This can be overwritten by the theme
}