From 4d0ab6d254578f8cdceb2551476166df3b1ee3d3 Mon Sep 17 00:00:00 2001 From: aravind Date: Tue, 16 Apr 2013 13:13:33 -0700 Subject: [PATCH] Null check for colorize --- hphp/util/trace.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hphp/util/trace.h b/hphp/util/trace.h index 7e65ce5bf..d58d7f0f8 100644 --- a/hphp/util/trace.h +++ b/hphp/util/trace.h @@ -244,6 +244,7 @@ inline const char* color(const char* color) { auto const traceEnv = getenv("HPHP_TRACE_FILE"); auto const assumeTTY = getenv("HPHP_TRACE_TTY"); if (assumeTTY) return true; + if (!traceEnv) return false; return !strcmp(traceEnv, "/dev/stdout") ? isatty(1) : !strcmp(traceEnv, "/dev/stderr") ? isatty(2) :