From b703c0ae4da6c5dd9d5c264050ba1388b601d8c2 Mon Sep 17 00:00:00 2001 From: SwissalpS Date: Wed, 18 Nov 2020 18:22:18 +0100 Subject: check if file handle actually exists --- plugins/lastproject.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/lastproject.lua') diff --git a/plugins/lastproject.lua b/plugins/lastproject.lua index 09ca507..5fb23bd 100644 --- a/plugins/lastproject.lua +++ b/plugins/lastproject.lua @@ -14,8 +14,10 @@ end -- save current project path local fp = io.open(last_project_filename, "w") -fp:write(system.absolute_path ".") -fp:close() +if nil ~= fp then + fp:write(system.absolute_path ".") + fp:close() +end -- restart using last project path if we had no commandline arguments and could @@ -24,3 +26,4 @@ if #ARGS == 1 and project_path then system.exec(string.format("%s %q", EXEFILE, project_path)) core.quit(true) end + -- cgit v1.2.3