From 0e5f6c2e6fe9d47181b45c66b5a784f8fbca9845 Mon Sep 17 00:00:00 2001 From: Brian Jacobel Date: Thu, 15 Dec 2016 10:04:48 -0500 Subject: [PATCH] Fix bug on new post creation where we would try to hide an element that wasn't there --- .../common/js/discussion/views/discussion_inline_view.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/static/common/js/discussion/views/discussion_inline_view.js b/common/static/common/js/discussion/views/discussion_inline_view.js index 7a44a6571a..c2f87a3ef7 100644 --- a/common/static/common/js/discussion/views/discussion_inline_view.js +++ b/common/static/common/js/discussion/views/discussion_inline_view.js @@ -156,9 +156,11 @@ this.$('.inline-thread').addClass('is-hidden'); // Delete the thread view - this.threadView.$el.empty().off(); - this.threadView.stopListening(); - this.threadView = null; + if (this.threadView) { + this.threadView.$el.empty().off(); + this.threadView.stopListening(); + this.threadView = null; + } // Show the thread list view this.threadListView.$el.removeClass('is-hidden');