From 8fbdd4258f927f17d2a12da3698243ad06aa5634 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Fri, 20 Aug 2021 11:22:17 +0200 Subject: [PATCH] Fix null error in ve.ui.MWTemplateDialog Introduced via Ifd52369 just a few minutes ago. Bug: T288827 Change-Id: I859f606c0608f9725bb64ff56a501a7a2c85c1df --- modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js index 03fe295677..1c3c6d59c8 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js @@ -113,7 +113,8 @@ ve.ui.MWTemplateDialog.prototype.onReplacePart = function ( removed, added ) { removed.disconnect( this ); } if ( this.loaded && !this.preventReselection && partPage.isActive() ) { - reselect = this.bookletLayout.findClosestPage( partPage ).getName(); + var closestPage = this.bookletLayout.findClosestPage( partPage ); + reselect = closestPage && closestPage.getName(); } removePages.push( partPage ); this.bookletLayout.removePages( removePages );