Fix selection check in wikitext warning

Change-Id: I2f084eb4ee29bd166b05163cd2d6e64e0a4f136d
This commit is contained in:
Ed Sanders 2014-10-27 16:21:24 +00:00
parent 358268be7a
commit ab365ccacc

View file

@ -770,9 +770,11 @@ ve.init.mw.ViewPageTarget.static.checkForWikitextWarning = function ( surface, w
var text, node, doc = surface.getView().getDocument(),
selection = surface.getModel().getSelection(),
textMatches;
if ( !selection ) {
if ( !( selection instanceof ve.dm.LinearSelection ) ) {
return;
}
node = doc.getBranchNodeFromOffset( selection.getRange().start );
if ( !( node instanceof ve.ce.ContentBranchNode ) ) {
return;