From b9ad2fb40693a10f0d4db05b4742456c4ca734f7 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Wed, 16 Jul 2014 17:50:41 +0100 Subject: [PATCH] Don't allow document save if we're already tearing down the surface Otherwise you get "Uncaught TypeError: Cannot read property 'messages' of null" if you press the save button late enough in the saving process. The bug refers to a different error which I have not been able to reproduce. Bug: 68073 Change-Id: Ia8fa325f1450329b6e0e4ee9af5302aa4857d637 --- modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index 0ec663f11e..5be82857b0 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -865,6 +865,10 @@ ve.init.mw.ViewPageTarget.prototype.onSaveDialogReviewComplete = function ( wiki * succeeds/fails. */ ve.init.mw.ViewPageTarget.prototype.saveDocument = function ( saveDeferred ) { + if ( this.deactivating ) { + return false; + } + var saveOptions = this.getSaveOptions(); this.emit( 'saveInitiated' );