handler: replace is_error() helper with NULL check