Closed francislavoie closed 6 years ago
I called darkroom.selfDestroy() but the container.parentNode is not defined and it throws exception. I added null check and your fix works for me.
image.onload = function() {
if (container.parentNode) {
container.parentNode.replaceChild(image, container);
}
this.onload = null;
}
Currently, if the src of the image is changed again, the bound onload call will be called again, which results in an error because replaceChild won't work after already being destroyed.
This is the fix I implemented, not sure if there's a more ideal way.