Feature: #100586 - Null-safe operator in TypoScript conditions¶
One of those new features is the null-safe operator. This operator is especially useful when accessing properties on objects, which however might not be available in some context, e.g. "TSFE" in the backend.
TYPO3 designed its custom expression functions in a way that they support the
usage of the null-safe operator by default. This is done by returning
NULL in case the requested object is not available.
Therefore, instead of
[getTSFE() && getTSFE().id == 123],
integrators can simplify the condition to
[getTSFE()?.id == 123].
It's now possible to simplify TypoScript conditions using the new expression language features, especially the null-safe operator.