Merge "Check surface exists when triggering toc rebuild"

This commit is contained in:
jenkins-bot 2016-07-06 17:56:58 +00:00 committed by Gerrit Code Review
commit 67ca0bd32b

View file

@ -46,7 +46,7 @@ ve.ce.MWHeadingNode.prototype.onTeardown = function () {
};
ve.ce.MWHeadingNode.prototype.rebuildToc = function () {
if ( this.surface.mwTocWidget ) {
if ( this.surface && this.surface.mwTocWidget ) {
this.surface.mwTocWidget.rebuild();
}
};