Hans van der Meer via ntg-context schrieb am 02.08.2021 um 18:21:
And in pathological cases where even this does not work (as I encountered a few days ago): 
\setbox\scratchbox=\vboxx{content}\ifdim\wd\scratchbox>\zeropoint .. \else .. \fi

This is how \doiftext works but it uses a \hbox.

Wolfgang