Merge pull request #839 from jgmdev/nil-nodes-fix
Fix cases of nil node.
This commit is contained in:
commit
b05a02cb28
|
@ -30,7 +30,9 @@ end
|
|||
|
||||
|
||||
function RootView:get_active_node()
|
||||
return self.root_node:get_node_for_view(core.active_view)
|
||||
local node = self.root_node:get_node_for_view(core.active_view)
|
||||
if not node then node = self:get_primary_node() end
|
||||
return node
|
||||
end
|
||||
|
||||
|
||||
|
@ -46,6 +48,7 @@ end
|
|||
|
||||
function RootView:get_active_node_default()
|
||||
local node = self.root_node:get_node_for_view(core.active_view)
|
||||
if not node then node = self:get_primary_node() end
|
||||
if node.locked then
|
||||
local default_view = self:get_primary_node().views[1]
|
||||
assert(default_view, "internal error: cannot find original document node.")
|
||||
|
|
Loading…
Reference in New Issue