From 78e32eb47d1435ef7b13eb678e1363616ba8d624 Mon Sep 17 00:00:00 2001
From: Eric Wong <eric@wsdjeg.net>
Date: Tue, 16 Apr 2024 14:57:06 +0800
Subject: [PATCH] fix(job): return 0 for empty table

---
 lua/spacevim/api/job.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lua/spacevim/api/job.lua b/lua/spacevim/api/job.lua
index ee0ff4e12..750de8001 100644
--- a/lua/spacevim/api/job.lua
+++ b/lua/spacevim/api/job.lua
@@ -92,6 +92,9 @@ function M.start(cmd, opts)
     end
     table.insert(argv, cmd)
   elseif type(cmd) == 'table' then
+    if #cmd == 0 then
+      return 0
+    end
     for _, v in ipairs(cmd) do
       if type(v) ~= 'string' then
         return 0