Commit ae96b354 authored by Ralf Zimmermann's avatar Ralf Zimmermann Committed by Andreas Fernandez
Browse files

[BUGFIX] avoid Call to a member function getValue() on a non-object

Prevents calling a method of a non-existent object.

If an attribute is not set via Typoscript no object for the attribute
is instantiated. It must be checked if the attribute exists before
calling it.

Resolves: #45685
Releases: 6.2, master
Change-Id: Ia36052060b82d543b22fb9c0da61623f9d09bd07

Tested-by: Björn Jacob's avatarBjoern Jacob <>
Reviewed-by: default avatarMichael Oehlhof <>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <>
parent d436dfef
......@@ -139,7 +139,11 @@ class AttributesAttribute {
* @return string The content of the attribute
public function getValue($key) {
return $this->getAttributeObjectByKey($key)->getValue();
if ($this->hasAttribute($key)) {
return $this->getAttributeObjectByKey($key)->getValue();
} else {
return '';
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment