Skip to content

Commit

Permalink
fix: avoid type error with undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavolivrare committed Apr 24, 2018
1 parent 9bf9d02 commit 9774ef1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ LivePatch.prototype._patch = function(type, value) {
var top = this.stack[this.stack.length - 1];
var parent = this.stack[this.stack.length - 2];

if (!top) return

if (top.type == 'array') {
parent = top;
this._pushKey(parent.counter.toString());
Expand Down

0 comments on commit 9774ef1

Please sign in to comment.