mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
MWImageModel: Check selectedNode exists before asking for property
Bug: T180521 Change-Id: I1c10929abd6f5c4afa03a65904bc76fc82f8fcbb
This commit is contained in:
parent
767865c8ed
commit
c41fd90a15
|
@ -458,7 +458,7 @@ ve.dm.MWImageModel.prototype.insertImageNode = function ( fragment ) {
|
|||
|
||||
switch ( nodeType ) {
|
||||
case 'mwInlineImage':
|
||||
if ( selectedNode.type === 'mwBlockImage' ) {
|
||||
if ( selectedNode && selectedNode.type === 'mwBlockImage' ) {
|
||||
// If converting from a block image, create a wrapper paragraph for the inline image to go in.
|
||||
fragment.insertContent( [ { type: 'paragraph', internal: { generated: 'wrapper' } }, { type: '/paragraph' } ] );
|
||||
offset = fragment.getSelection().getRange().start + 1;
|
||||
|
|
Loading…
Reference in a new issue