aboutsummaryrefslogtreecommitdiff
path: root/plugins/workspace.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/workspace.lua')
-rw-r--r--plugins/workspace.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/workspace.lua b/plugins/workspace.lua
index 8f8dfcc..028e0a2 100644
--- a/plugins/workspace.lua
+++ b/plugins/workspace.lua
@@ -126,8 +126,10 @@ end
local function save_workspace()
local root = get_unlocked_root(core.root_view.root_node)
local fp = io.open(workspace_filename, "w")
- fp:write("return ", serialize(save_node(root)), "\n")
- fp:close()
+ if fp then
+ fp:write("return ", serialize(save_node(root)), "\n")
+ fp:close()
+ end
end