From 29c303535ed7da4f1236a5c5a1dc8df5712b3a2c Mon Sep 17 00:00:00 2001 From: fiplox Date: Sun, 29 Jan 2023 13:59:41 +0100 Subject: [PATCH] fix: handle error if exec fails --- lua/config/mappings.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/config/mappings.lua b/lua/config/mappings.lua index 98a10c9..d39aee6 100644 --- a/lua/config/mappings.lua +++ b/lua/config/mappings.lua @@ -94,6 +94,9 @@ if os.getenv 'SSH_TTY' then MapDHM() else local handle = io.popen 'lsusb | grep -c Sofle' + if handle == nil then + return + end local automap = handle:read '*n' handle:close() if automap == 1 then