Skip to content

Commit 9b5d320

Browse files
Merge pull request #194 from horike37/feature/fix_issue_193
fix: handle null values
2 parents 570f764 + 3c3194f commit 9b5d320

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

lib/deploy/stepFunctions/compileStateMachines.test.js

+31
Original file line numberDiff line numberDiff line change
@@ -711,4 +711,35 @@ describe('#compileStateMachines', () => {
711711
expect(params).to.haveOwnProperty(functionParam2);
712712
expect(params[functionParam2]).to.eql({ Ref: 'MyFunction2' });
713713
});
714+
715+
it('should allow null values #193', () => {
716+
serverless.service.stepFunctions = {
717+
stateMachines: {
718+
myStateMachine1: {
719+
id: 'Test',
720+
name: 'test',
721+
definition: {
722+
StartAt: 'AnyStep',
723+
States: {
724+
AnyStep: {
725+
Type: 'Pass',
726+
ResultPath: null,
727+
Next: 'Finish',
728+
},
729+
Finish: {
730+
Type: 'Succeed',
731+
},
732+
},
733+
},
734+
},
735+
},
736+
};
737+
738+
serverlessStepFunctions.compileStateMachines();
739+
const stateMachine = serverlessStepFunctions.serverless.service
740+
.provider.compiledCloudFormationTemplate.Resources
741+
.Test;
742+
743+
expect(stateMachine.Properties.DefinitionString).to.not.equal(null);
744+
});
714745
});

lib/utils/aws.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
const _ = require('lodash');
2+
13
function isIntrinsic(obj) {
2-
return typeof obj === 'object' &&
4+
return _.isObjectLike(obj) &&
35
Object.keys(obj).some((k) => k.startsWith('Fn::') || k.startsWith('Ref'));
46
}
57

0 commit comments

Comments
 (0)