Fixed minor error that occurs when saving as after viewing a non-doc tab.

This commit is contained in:
Adam Harrison 2021-05-24 17:26:16 -04:00
parent f17f5a4d6d
commit 8acb3fae8c
1 changed files with 1 additions and 1 deletions

View File

@ -343,7 +343,7 @@ local commands = {
["doc:save-as"] = function()
if doc().filename then
core.command_view:set_text(doc().filename)
elseif core.last_active_view then
elseif core.last_active_view and core.last_active_view.doc then
local dirname, filename = core.last_active_view.doc.abs_filename:match("(.*)[/\\](.+)$")
core.command_view:set_text(core.normalize_to_project_dir(dirname) .. PATHSEP)
end