Fix cases of nil node.
This commit is contained in:
parent
dc5888bc07
commit
bb4569da53
|
@ -30,7 +30,9 @@ end
|
||||||
|
|
||||||
|
|
||||||
function RootView:get_active_node()
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,6 +48,7 @@ end
|
||||||
|
|
||||||
function RootView:get_active_node_default()
|
function RootView:get_active_node_default()
|
||||||
local node = 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
|
||||||
if node.locked then
|
if node.locked then
|
||||||
local default_view = self:get_primary_node().views[1]
|
local default_view = self:get_primary_node().views[1]
|
||||||
assert(default_view, "internal error: cannot find original document node.")
|
assert(default_view, "internal error: cannot find original document node.")
|
||||||
|
|
Loading…
Reference in New Issue