From 6ecb811510830c8ff281c777ccd367115c0a82d0 Mon Sep 17 00:00:00 2001 From: Nick deLannoy Date: Sat, 14 Sep 2024 15:59:24 -0500 Subject: [PATCH 1/2] fix nil error on PR open --- lua/litee/gh/pr/marshal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/litee/gh/pr/marshal.lua b/lua/litee/gh/pr/marshal.lua index ac5ba63..c88dfab 100644 --- a/lua/litee/gh/pr/marshal.lua +++ b/lua/litee/gh/pr/marshal.lua @@ -73,7 +73,7 @@ local function marshal_thread_node(use_original) line = node.thread["line"] end local root_comment = node["children"][1]["comment"] - if root_comment["originalCommit"] ~= vim.NIL then + if root_comment["originalCommit"] ~= nil and root_comment["originalCommit"]["oid"] ~= nil then detail = string.sub(root_comment["originalCommit"]["oid"], 1, 8) detail = "@ " .. detail end From 73a8bd728929e37519fcd5436554f20e74138fac Mon Sep 17 00:00:00 2001 From: Nick deLannoy Date: Sat, 14 Sep 2024 16:32:21 -0500 Subject: [PATCH 2/2] fix another line --- lua/litee/gh/pr/marshal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/litee/gh/pr/marshal.lua b/lua/litee/gh/pr/marshal.lua index c88dfab..6d1ed94 100644 --- a/lua/litee/gh/pr/marshal.lua +++ b/lua/litee/gh/pr/marshal.lua @@ -47,7 +47,7 @@ local function marshal_thread_node(use_original) line = node.thread["originalLine"] end local root_comment = node["children"][1]["comment"] - if root_comment["originalCommit"] ~= vim.NIL then + if root_comment["originalCommit"] ~= nil and root_comment["originalCommit"]["oid"] ~= nil then detail = string.sub(root_comment["originalCommit"]["oid"], 1, 8) detail = "@ " .. detail end