logging: Guard against log color being undefined.

The 'info' log facility uses the default color, which is not present in
`LEVEL_COLORS`, thus `undefined` and unable to be `slice`d.

(As reported by @brucejo75).

Refs: https://github.com/meteor/meteor/pull/8728#issuecomment-336324674
Refs: meteor/meteor#9170
This commit is contained in:
Jesse Rosenberger
2017-10-13 14:12:07 +03:00
parent 525cbc33b3
commit ce27323caf
2 changed files with 2 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ var META_COLOR = 'blue';
// ops per second (on Node 8) by caching "process.platform".
var isWin32 = typeof process === 'object' && process.platform === 'win32';
var platformColor = function (color) {
if (isWin32 && color.slice(-6) !== 'Bright') {
if (isWin32 && typeof color === 'string' && color.slice(-6) !== 'Bright') {
return color + 'Bright';
}
return color;

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Logging facility.",
version: '1.1.18'
version: '1.1.19'
});
Npm.depends({