Issue Bug Closed

#99906Constant Editor emits "Call to a member function getType() on null" Exception if TypoScript constant uses "copy operator <"

Stefan Bürk 02/09/23, 17:41 updated 03/14/23, 11:47

Description

Backend badly crashes with an exception, if `TypoScript -> Constant Editor` is called,
and the TypoScript constants code contains references to prip defined constants with
constant-editor configuration comments.

# cat=custom/a; type=color; label=Primary Color
plugin.tx_example.primaryColor = #282E31

# cat=custom/a; type=color; label=Other Color
plugin.tx_example.otherColor < plugin.tx_example.primaryColor

First thought has been, that it’s erlated to the
hash of the color value, but it’s not.

# cat=custom/a; type=input; label=Primary Color
plugin.tx_example.primaryColor = some-text

# cat=custom/a; type=input; label=Other Color
plugin.tx_example.otherColor < plugin.tx_example.primaryColor

Following exception is thrown:

Auswahl_1198.png

If

$firstTokenType = $trimmedTokenStream->peekNext()->getType();

is replaced with

$firstTokenType = $trimmedTokenStream->peekNext()?->getType();

It would work. However, the question is, beside having that guard here,
if the issue is related basically in another place first.

Reviews 1