diff --git a/modules/ve/dm/ve.dm.InternalList.js b/modules/ve/dm/ve.dm.InternalList.js index 8bd1cc5497..88dd1f052c 100644 --- a/modules/ve/dm/ve.dm.InternalList.js +++ b/modules/ve/dm/ve.dm.InternalList.js @@ -29,7 +29,9 @@ ve.dm.InternalList = function VeDmInternalList( doc ) { this.nextUniqueNumber = 0; // Event handlers - this.document.connect( this, { 'transact': 'onTransact' } ); + if ( doc ) { + doc.connect( this, { 'transact': 'onTransact' } ); + } }; /* Inheritance */