Add variant nenad

The logic inside this ``if`` and inside the following can be reused in a function such as ``emitErrorAndEnd``