Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions TextformatterSrcset.module
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class TextformatterSrcset extends Textformatter implements ConfigurableModule {

//Thanks to Horst Nogajski for the following snippet
foreach($p->fields as $field) {
if (! (bool) ($field->type instanceof FieldtypeImage)) continue; // if no images field, go on
if (! (bool) ($field->type instanceof FieldtypeImage) || is_null($p->get($field->name))) continue; // if no images field or null, go on

// find the field that holds the image
if (!$p->get($field->name)->has('name=' . $meta['imageName'] . '.' . $meta['ext'])) continue;
Expand Down Expand Up @@ -339,4 +339,4 @@ class TextformatterSrcset extends Textformatter implements ConfigurableModule {

return $wrapper;
}
}
}