Bug 717912, bug 717872 and probably bug 718364 are caused by assuming that the RTCDataChannel handler is never null.
This assumption is incorrect, and crrev.com/2888043003 fixes it for close and send, which are the methods directly causing the bugs.
A solution must be found for other methods that assume they are never called with a null handler (and are currently not causing problems) and which return values to the caller.
A possible solution is to throw a JavaScript exception, but the spec compliance of this solution needs to be assessed.
Comment 1 by guidou@chromium.org
, May 22 2017