MarkAHershberger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/197375

Change subject: Address an exception seen in IE when copy-pasting line endings
......................................................................

Address an exception seen in IE when copy-pasting line endings

More description at https://phabricator.wikimedia.org/T92969#1125980, and this 
should probably have something indicating who called the function with a value 
that would cause the exception, but my JS-Foo is really bad.

Bug: T92969
Change-Id: I202511b5cc4e2a87497928b6c5c0078f6f7be9dd
---
M src/dm/ve.dm.LinearData.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/75/197375/1

diff --git a/src/dm/ve.dm.LinearData.js b/src/dm/ve.dm.LinearData.js
index a274096..e28f9eb 100644
--- a/src/dm/ve.dm.LinearData.js
+++ b/src/dm/ve.dm.LinearData.js
@@ -35,7 +35,11 @@
  * @returns {string} Type of the element
  */
 ve.dm.LinearData.static.getType = function ( item ) {
-       return this.isCloseElementData( item ) ? item.type.slice( 1 ) : 
item.type;
+       if ( item ) {
+               return this.isCloseElementData( item ) ? item.type.slice( 1 ) : 
item.type;
+       } else {
+               return null;
+       }
 };
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I202511b5cc4e2a87497928b6c5c0078f6f7be9dd
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to