Check clipboardData exists before accessing it

Bug fix for browsers which don't have an event.clipboardData
property. The check is done correctly in onCopy but not onPaste.

Change-Id: I3cdf4c0358aa145dcb70c2c103d08a0002001fd4
This commit is contained in:
Ed Sanders 2013-08-28 11:47:13 -07:00
parent f50102f521
commit 182d9bbeea

View file

@ -677,8 +677,8 @@ ve.ce.Surface.prototype.onPaste = function ( e ) {
view = this,
selection = this.model.getSelection(),
clipboardData = e.originalEvent.clipboardData,
eventPasteKey = clipboardData.getData( 'text/xcustom' ) || null,
eventPasteText = clipboardData.getData( 'text/plain' ) || null;
eventPasteKey = clipboardData && clipboardData.getData( 'text/xcustom' ),
eventPasteText = clipboardData && clipboardData.getData( 'text/plain' );
this.surfaceObserver.stop( false, true );