Skip to content

Commit c3c1949

Browse files
committed
Adding undefined guards
1 parent 67e03a4 commit c3c1949

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class ServerlessDynamodbLocal {
105105
}
106106
};
107107

108-
const stage = (this.options && this.options.stage) || this.service.provider.stage;
108+
const stage = (this.options && this.options.stage) || (this.service.provider && this.service.provider.stage);
109109
if (this.config.stages && !this.config.stages.includes(stage)) {
110110
// don't do anything for this stage
111111
this.hooks = {};

test/testTable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ describe("Check Table operations", function() {
4444
it("should connect to dynamodb and list tables", function(done) {
4545
db.listTables({}, function(err, data) {
4646
if(err){
47+
console.log("==== error hit ====");
4748
should.exist(err);
4849
} else {
50+
console.log("==== Not error hit ====");
4951
expect(data.TableNames).to.be.empty;
5052
}
5153
done();

0 commit comments

Comments
 (0)