From df840fe2633601b2cf834f1c7a15787322f56fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20K=C3=A4rnstr=C3=B6m?= Date: Thu, 3 Oct 2019 16:47:36 +0200 Subject: [PATCH] fix(defaultValues): Added fallback for optional default values We are using [commitizen](https://github.com/commitizen/cz-cli) and after bumping it to version 4.0.3 that bumped the version of [cz-conventional-changelog](https://github.com/commitizen/cz-conventional-changelog) to version 3.0.1 we started getting the error message . After some investigating we could track it to the default values introduced in PR [#69](https://github.com/commitizen/cz-conventional-changelog/pull/69). This PR makes it so the default values are optional and safeguards so if no default values are present it does not crash. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index bbc44f59..e9ed5896 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ var engine = require('./engine'); var conventionalCommitTypes = require('conventional-commit-types'); var configLoader = require('commitizen').configLoader; -var config = configLoader.load(); +var config = configLoader.load() || {}; var options = { types: conventionalCommitTypes.types, defaultType: process.env.CZ_TYPE || config.defaultType,