Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle case where specified listener is not registered in call to unr…

…egisterListener
  • Loading branch information...
commit 1b0f1358bb94d21c3d3dca03e39e7843c107465a 1 parent 25d4826
Matt Oshry authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/core/scxml/SCXML.js
View
8 lib/core/scxml/SCXML.js
@@ -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;
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.