From 8ec5eefde864da310533fb75d283abbc51eb3279 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sun, 20 Feb 2011 19:27:03 +0000 Subject: [PATCH] (bug 27355) Guard against context being null, this happens when wikiEditor disables itself in unsupported browsers and was causing a JS error --- resources/jquery/jquery.textSelection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/jquery/jquery.textSelection.js b/resources/jquery/jquery.textSelection.js index 6faeab8b31..d84a5c240a 100644 --- a/resources/jquery/jquery.textSelection.js +++ b/resources/jquery/jquery.textSelection.js @@ -386,7 +386,7 @@ scrollToCaretPosition: function( options ) { break; } var context = $(this).data( 'wikiEditor-context' ); - var hasIframe = context !== undefined && context.$iframe !== undefined; + var hasIframe = typeof context !== 'undefined' && context && typeof context.$iframe !== 'undefined'; // IE selection restore voodoo var needSave = false; -- 2.20.1