Calling scheduler.detachAllEvents() causing error

Calling scheduler.detachAllEvents() will throw the following error.

Trace Log:

TypeError: Cannot read property 'removeEvent' of null at Object.obj.detachEvent (http://127.0.0.1:8080/libs/dhtmlx/dhtmlxscheduler.js:52:231) at Object.obj.detachAllEvents (http://127.0.0.1:8080/libs/dhtmlx/dhtmlxscheduler.js:52:329)

Any ideas? I tried a lot but I can’t fix it.

Please check the reply here viewtopic.php?f=6&t=49954