From 7205ee37b9b7698626da11e9beb5a4cfb087e4aa Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 4 Oct 2016 03:24:12 -0700 Subject: [PATCH] Deal with thread.nodes.root not existing. I don't think it's possible to trigger this case, but might as well make it more robust (and consistent). --- src/Miscellaneous/ExpandThread.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Miscellaneous/ExpandThread.coffee b/src/Miscellaneous/ExpandThread.coffee index 9bd383e8a..bc78d3e41 100644 --- a/src/Miscellaneous/ExpandThread.coffee +++ b/src/Miscellaneous/ExpandThread.coffee @@ -34,10 +34,9 @@ ExpandThread = ExpandThread.toggle Get.threadFromNode @ toggle: (thread) -> - threadRoot = thread.nodes.root - return if not (a = $ '.summary', threadRoot) + return if not (thread.nodes.root and (a = $ '.summary', thread.nodes.root)) if thread.ID of ExpandThread.statuses - ExpandThread.contract thread, a, threadRoot + ExpandThread.contract thread, a, thread.nodes.root else ExpandThread.expand thread, a