From the JLS: 15.25. Conditional Operator ? :
If one of the second and third operands is of primitive type T, and the type of the other is the result of applying boxing conversion (§5.1.7) to T, then the type of the conditional expression is T.
Aka: when the 2nd and 3rd operand are primitive and boxed reference type, the result is considered the primitive type. At the end of your operation you are boxing it again, but by then you have already tried to assign null to a primitive type - which isn't possible.
The signature of String#equalsIgnoreCase is...
public boolean equalsIgnoreCase