From 182d9bbeea2a18f4846db8d626d2cf81e3f3162a Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 28 Aug 2013 11:47:13 -0700 Subject: [PATCH] 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 --- modules/ve/ce/ve.ce.Surface.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js index da4bca0d9a..957eacbb2e 100644 --- a/modules/ve/ce/ve.ce.Surface.js +++ b/modules/ve/ce/ve.ce.Surface.js @@ -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 );