Ensure top() exists before attempting to return instance
This commit is contained in:
parent
6af0861dfe
commit
32fe815ea2
|
@ -145,5 +145,8 @@ MenuStack.prototype.goto = function(name, options, cb) {
|
|||
};
|
||||
|
||||
MenuStack.prototype.getCurrentModule = function() {
|
||||
return this.top().instance;
|
||||
var top = this.top();
|
||||
if(top) {
|
||||
return top.instance;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue