﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
9684	"Type error when nothing is selected in checkSelectionChange() (Cannot call method ""getType"" of null)"	Jeremie Miserez		"Version: 4.x Nightly (Rev. 3952)
The call to a.getType() will fail, as the function getSelection(1) can return null.

{{{
function b() {
                var a = this.getSelection(1);
                if (a.getType() != CKEDITOR.SELECTION_NONE) {
                    this.fire(""selectionCheck"", a);
                    var b = this.elementPath();
                    if (!b.compare(this._.selectionPreviousPath)) {
                        this._.selectionPreviousPath = b;
                        this.fire(""selectionChange"", {selection: a,path: b})
                    }
                }
            }
}}}

The corresponding source code would be in: core/selection.js at line 15
{{{
function checkSelectionChange() {
		// Editor may have no selection at all.
		var sel = this.getSelection( 1 );
		if ( sel.getType() == CKEDITOR.SELECTION_NONE )
			return;

		this.fire( 'selectionCheck', sel );

		var currentPath = this.elementPath();
		if ( !currentPath.compare( this._.selectionPreviousPath ) ) {
			this._.selectionPreviousPath = currentPath;
			this.fire( 'selectionChange', { selection: sel, path: currentPath } );
		}
	}
}}}

"	Bug	closed	Normal		General	4.0	duplicate	IBM	jan_wloka@…
