From ce27323caf3bf9156909218cedca25c52104d22e Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Fri, 13 Oct 2017 14:12:07 +0300 Subject: [PATCH] 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 --- packages/logging/logging.js | 2 +- packages/logging/package.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/logging/logging.js b/packages/logging/logging.js index 2cd8ac150e..f07c9c93c5 100644 --- a/packages/logging/logging.js +++ b/packages/logging/logging.js @@ -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; diff --git a/packages/logging/package.js b/packages/logging/package.js index ec1e8adc3d..e37cf530b0 100644 --- a/packages/logging/package.js +++ b/packages/logging/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Logging facility.", - version: '1.1.18' + version: '1.1.19' }); Npm.depends({