Skip to content

Commit df840fe

Browse files
committed
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 [commitizen#69](commitizen#69). This PR makes it so the default values are optional and safeguards so if no default values are present it does not crash.
1 parent 4b23bbc commit df840fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var engine = require('./engine');
44
var conventionalCommitTypes = require('conventional-commit-types');
55
var configLoader = require('commitizen').configLoader;
66

7-
var config = configLoader.load();
7+
var config = configLoader.load() || {};
88
var options = {
99
types: conventionalCommitTypes.types,
1010
defaultType: process.env.CZ_TYPE || config.defaultType,

0 commit comments

Comments
 (0)