diff -Naur node_modules/granax/lib/controller.js node_patch/granax/lib/controller.js --- node_modules/granax/lib/controller.js 1985-10-26 09:15:00.000000000 +0100 +++ node_patch/granax/lib/controller.js 2018-11-18 17:29:52.470853999 +0100 @@ -177,6 +177,7 @@ switch (code.toString()[0]) { case '2': + if (this._stack.length == 0) { console.error("Stack is empty, bug!"); break; } let { method, callback } = this._stack.pop(); let parsed = replies[method] ? replies[method](lines) @@ -185,6 +186,7 @@ break; case '4': case '5': + if (this._stack.length == 0) { console.error("Stack is empty, bug!"); break; } this._stack.pop().callback(new Error(lines[0])); break; case '6':