[Fixes #6133140] withoutTrailingOperatorD fix

Whenever this method was used on an expression that
was empty, it would cause an error.