From f04c36b499630d7aee58ff7470e35792661baed8 Mon Sep 17 00:00:00 2001 From: jakewvincent Date: Sun, 18 Aug 2024 11:51:38 -0700 Subject: [PATCH] fix: Check for nil --- lua/mkdnflow/paths.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/mkdnflow/paths.lua b/lua/mkdnflow/paths.lua index 0832a9a..665ee49 100644 --- a/lua/mkdnflow/paths.lua +++ b/lua/mkdnflow/paths.lua @@ -457,7 +457,7 @@ local truncate_path = function(oldpath, newpath) char = char + 1 end end - if char > last_slash then + if last_slash and char > last_slash then difference = string.sub(newpath, last_slash) else difference = string.sub(newpath, char)