Check the return value of MCS_getenv(), not the pointer in the stringref.