Method Condition.hasClass is null-safe