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