Page MenuHomePhabricator

VisualEditor: Various actions that trigger retrieval of offsets throw uncaught exceptions
Closed, ResolvedPublic

Description

Little hard to reproduce but has come up several times. Selecting some text, playing around with the inspector and pasting some text.

Stack:

Uncaught TypeError: Cannot call method 'canHaveChildren' of null

ve.dm.Document.getNodeFromOffset
ve.ui.Toolbar.updateTools
ve.EventEmitter.emit
ve.dm.Surface.change
ve.ce.Surface.onPaste
jQuery.extend.proxy.proxy
jQuery.event.dispatch
jQuery.event.add.elemData.handle.eventHandle

ve.dm.Document.prototype.getNodeFromOffset = function(offset) {

var node = this.documentNode.getNodeFromOffset(offset);
if (!node.canHaveChildren

Uncaught TypeError: Cannot call method 'canHaveChildren' of null

()) {
    node = node.getParent();
}
r

Version: unspecified
Severity: normal

Details

Reference
bz40463

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:07 AM
bzimport set Reference to bz40463.

Thought this one got fixed, but clearly not. :-)

Aside from Surface.change, Surface.showSelection also has a similar problem:

http://cl.ly/image/1v1h3f2M2722

Pushing to next milestone as they did not make it to master by yesterday.

This was fixed in Ia7347527e6466262e819f456404b32926fd95e34