GROOVY-6342: Fix NPE in static compilation with ternary operator and elvis