From f83e619fd97883d9e55494c2f3cc7e84d98fd5a8 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Sat, 28 Jan 2012 17:25:24 -0800 Subject: [PATCH] Null-out the padeditor's reference to ace once it has been distroyed. This enables the guards placed in `padeditor.disable` to work. On `window.unload` the pad's connection would get closed which would lead to the editor becomming disabled. If the editor had already been `disposed` then the call to `disable` would raise the exception: `Uncaught TypeError: Cannot call method 'ace_setProperty' of null` --- static/js/pad_editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/static/js/pad_editor.js b/static/js/pad_editor.js index 6d3cbf40..d336aa87 100644 --- a/static/js/pad_editor.js +++ b/static/js/pad_editor.js @@ -141,6 +141,7 @@ var padeditor = (function() if (self.ace) { self.ace.destroy(); + self.ace = null; } }, disable: function()