Fix incomplete return in DesktopArticleTarget.tryTeardown()

If a teardown has started, there should be a teardownPromise,
otherwise return a rejected promise.

Bug: T268358
Change-Id: Ia5cbd6b409a38f97243234ea7c87d24f71bdf3d6
This commit is contained in:
Thiemo Kreuz 2020-12-01 08:43:33 +01:00 committed by Bartosz Dziewoński
parent 3e6d5c6817
commit fb0e33f987

View file

@ -559,7 +559,7 @@ ve.init.mw.DesktopArticleTarget.prototype.teardownNewSection = function ( surfac
*/
ve.init.mw.DesktopArticleTarget.prototype.tryTeardown = function ( noPrompt, trackMechanism ) {
if ( this.deactivating || ( !this.active && !this.activating ) ) {
return;
return this.teardownPromise || ve.createDeferred().reject().promise();
}
// Just in case these weren't closed before