From 2a8405e2ad4cdf6d1291d4583daeea5639202d2b Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 14 Jul 2009 19:56:36 -0700 Subject: [PATCH] Fixed a bug that prevent "new note" button from working in discussion forums. --- static/js/Editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/Editor.js b/static/js/Editor.js index 232f2ad..afb88aa 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -1031,10 +1031,11 @@ Editor.prototype.cleanup_html = function ( key_code ) { } Editor.prototype.cleanup_range = function () { - if ( this.iframe.contentWindow.getSelection ) + if ( this.iframe && this.iframe.contentWindow.getSelection ) { var selection = this.iframe.contentWindow.getSelection(); if ( selection.isCollapsed ) this.exec_command( "removeformat" ); + } } Editor.prototype.unformat_selection = function () {