From 3d490658e18fbd171840cb8b8db90bb6c3393735 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Fri, 5 May 2017 13:34:27 -0500 Subject: [PATCH] fix `undefined` when options has no description When an option doesn't have a description `undefined` prefixes the (Supported by ...) declaration in the settings --- script/build-options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build-options.js b/script/build-options.js index 43141a4..5736fc1 100644 --- a/script/build-options.js +++ b/script/build-options.js @@ -133,9 +133,9 @@ buildOptionsForBeautifiers = function(beautifiers, allLanguages) { return _.reduce(languageOptions, (function(result, optionDef, optionName) { optionDef.beautifiers = _.uniq(optionDef.beautifiers) if (optionDef.beautifiers.length > 0) { - optionDef.description = optionDef.description + " (Supported by " + (optionDef.beautifiers.join(', ')) + ")"; + optionDef.description = (optionDef.description || "") + " (Supported by " + (optionDef.beautifiers.join(', ')) + ")"; } else { - optionDef.description = optionDef.description + " (Not supported by any beautifiers)"; + optionDef.description = (optionDef.description || "") + " (Not supported by any beautifiers)"; } if (result[optionName] != null) { logger.warn("Duplicate option detected: ", optionName, optionDef);