Skip to content

Commit ddf9074

Browse files
committed
Return null from getSelection when not in wysiwyg mode.
1 parent f8d97f2 commit ddf9074

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/selection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
sel = this.getSelection( 1 );
4040

4141
// Editor may have no selection at all.
42-
if ( sel.getType() == CKEDITOR.SELECTION_NONE )
42+
if ( !sel || sel.getType() == CKEDITOR.SELECTION_NONE )
4343
return;
4444
}
4545

@@ -630,9 +630,9 @@
630630
if ( ( this._.savedSelection || this._.fakeSelection ) && !forceRealSelection )
631631
return this._.savedSelection || this._.fakeSelection;
632632

633-
// Editable element might be absent.
633+
// Editable element might be absent or editor might not be in a wysiwyg mode.
634634
var editable = this.editable();
635-
return editable ? new CKEDITOR.dom.selection( editable ) : null;
635+
return editable && this.mode == 'wysiwyg' ? new CKEDITOR.dom.selection( editable ) : null;
636636
};
637637

638638
/**

0 commit comments

Comments
 (0)