Handle critical errors (null pointer) when evaluating expressions.
Updated handler signature.