Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
handle case where specified listener is not registered in call to unr…
Browse files Browse the repository at this point in the history
…egisterListener
  • Loading branch information
Matt Oshry committed Jun 6, 2013
1 parent 25d4826 commit 1b0f135
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/core/scxml/SCXML.js
Expand Up @@ -560,7 +560,13 @@ SCXMLInterpreter.prototype = {

/** @expose */
unregisterListener : function(listener){
return this._listeners.splice(this._listeners.indexOf(listener),1);
var retval;
var index = this._listeners.indexOf(listener);
if (index >= 0) {
retval = this._listeners.splice(index,1);
}

return retval;
}

};
Expand Down

0 comments on commit 1b0f135

Please sign in to comment.