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).
This commit is contained in:
ccd0 2016-10-04 03:24:12 -07:00
parent f3e2cbb19e
commit 7205ee37b9

View File

@ -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