diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js index 4d525b51ff..2d8e3cbd64 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js @@ -246,7 +246,7 @@ ve.dm.MWImageNode.prototype.onAttributeChange = function ( key, from, to ) { */ ve.dm.MWImageNode.prototype.getFilename = function () { // Strip ./ stuff and decode URI encoding - var resource = this.getAttribute( 'resource' ), + var resource = this.getAttribute( 'resource' ) || '', filename = resource.replace( /^(\.+\/)*/, '' ); // Protect against decodeURIComponent() throwing exceptions