ckeditor/ckeditor-dev — pull request #56 by jimmykane (2013-09-07 14:29:22+00:00)
Title: Check if iframe exists before clearing custom data

The issue was introduced when someone uses ckeditor as an AngularJS directive.

I wrote a directive that before initializing an instance of CKEDITOR if first destroys all existing ones.
So far so good. But if I have a ckeditor instance initilized and I remove the directive with angularJS (eg inside repear) then the iframe becomes null and thus a error popsup.

'Uncaught TypeError: Cannot call method 'clearCustomData' of null'

This is the case scenario:

1. Bind an instance to an element using the CKEDITOR.replace
2. Having the instance open remove the element using ANGULARJS
3. Try to use destroy on all existing instances.
4. Error. 'Uncaught TypeError: Cannot call method 'clearCustomData' of null'