Add better guards to ErrorFormatter for TS_SKIP(NULL) null pointer issue