Skip to content

Commit

Permalink
fix(inject-rule): Fixing error when no constructor is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
fragsalat authored and bryanrsmith committed Oct 15, 2018
1 parent cf9c96d commit b78c164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/inject-matches-ctor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function injectMatchesCtorRule(context) {
context.report(duplicateInject.node, 'Unexpected duplicate inject.');
}

const ctorParamsLength = injectInfo.ctor.params.length;
const ctorParamsLength = injectInfo.ctor.params ? injectInfo.ctor.params.length : 0;
if (injectElement.deps.length !== ctorParamsLength) {
context.report(injectElement.node, 'Constructor parameters do not match injected dependencies.');
}
Expand Down

0 comments on commit b78c164

Please sign in to comment.