From a9138468f96e6c354b92c692af634183951ec81c Mon Sep 17 00:00:00 2001 From: olimorris Date: Tue, 2 Jul 2024 19:32:12 +0100 Subject: [PATCH] chore: handle null parameters on `ignore_branch` --- lua/persisted/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/persisted/init.lua b/lua/persisted/init.lua index 2df64e9..f0bf721 100644 --- a/lua/persisted/init.lua +++ b/lua/persisted/init.lua @@ -80,12 +80,12 @@ local function ignore_dir(dir) end ---Is the current branch ignored for auto-saving and loading? ----@param dir string Branch to be used for the session +---@param branch? string Branch to be used for the session ---@return boolean local function ignore_branch(branch) local ignored_branches = config.options.ignored_branches - if ignored_branches == nil then + if not branch or ignored_branches == nil then return false end