Could do that but I don't think it's necessary - could just cast the return to an int in this case.

though TBH we can just remove the ternary now (and basically all other ternaries) as it's not possible in normal circumstances for the env call to return null.