jenkins-bot has submitted this change and it was merged.

Change subject: Check previousSelection is set before setting it
......................................................................


Check previousSelection is set before setting it

Bug: T147232
Change-Id: I39edff5cee4351c60c43fda2c5ad9ab4bf0dca7b
---
M src/ui/inspectors/ve.ui.AnnotationInspector.js
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/ui/inspectors/ve.ui.AnnotationInspector.js 
b/src/ui/inspectors/ve.ui.AnnotationInspector.js
index 2c20ff9..ace79aa 100644
--- a/src/ui/inspectors/ve.ui.AnnotationInspector.js
+++ b/src/ui/inspectors/ve.ui.AnnotationInspector.js
@@ -271,7 +271,9 @@
                        if ( !remove ) {
                                if ( data.action !== 'done' ) {
                                        surfaceModel.popStaging();
-                                       surfaceModel.setSelection( 
this.previousSelection );
+                                       if ( this.previousSelection ) {
+                                               surfaceModel.setSelection( 
this.previousSelection );
+                                       }
                                        return;
                                }
                                if ( this.initialSelection.isCollapsed() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/316014
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I39edff5cee4351c60c43fda2c5ad9ab4bf0dca7b
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to