From: Roan Kattouw Date: Sun, 20 Feb 2011 19:27:03 +0000 (+0000) Subject: (bug 27355) Guard against context being null, this happens when wikiEditor disables... X-Git-Tag: 1.31.0-rc.0~31850 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/Category:Foo?a=commitdiff_plain;h=8ec5eefde864da310533fb75d283abbc51eb3279;p=lhc%2Fweb%2Fwiklou.git (bug 27355) Guard against context being null, this happens when wikiEditor disables itself in unsupported browsers and was causing a JS error --- 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;