aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2021-09-04 00:32:01 +0200
committerGuldoman <giulio.lettieri@gmail.com>2021-09-04 00:32:01 +0200
commit371914af67384c9196062deeec1cbb9911fad89d (patch)
tree45af4d27446ea3e457898453ba56636ca2063902
parenta134c8ea99d4dd15e1f9c862ad88a1bef579b4d7 (diff)
downloadlite-xl-371914af67384c9196062deeec1cbb9911fad89d.tar.gz
lite-xl-371914af67384c9196062deeec1cbb9911fad89d.zip
Check if session file returned anything
-rw-r--r--data/core/init.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/core/init.lua b/data/core/init.lua
index 3bf10211..6b770fd6 100644
--- a/data/core/init.lua
+++ b/data/core/init.lua
@@ -17,7 +17,7 @@ local core = {}
local function load_session()
local ok, t = pcall(dofile, USERDIR .. "/session.lua")
- if ok then
+ if ok and t then
return t.recents, t.window, t.window_mode
end
return {}
@@ -441,7 +441,7 @@ function core.init()
elseif window_mode == "maximized" then
system.set_window_mode("maximized")
end
- core.recent_projects = recent_projects
+ core.recent_projects = recent_projects or {}
end
local project_dir = core.recent_projects[1] or "."