summaryrefslogtreecommitdiff
path: root/lua/aotrix/build.lua
diff options
context:
space:
mode:
authorAotrix <[email protected]>2026-06-15 21:46:06 +0200
committerAotrix <[email protected]>2026-06-15 21:46:06 +0200
commiteebf37e636fc06f3ccdef015901e154ed24a3cec (patch)
tree416d7d5ea7ee3912807d92fcc85a6fdaff2914f4 /lua/aotrix/build.lua
parent3b0c4da42660754aa17ad18451e2e520b2f40568 (diff)
Add nil check after reading file
Diffstat (limited to 'lua/aotrix/build.lua')
-rw-r--r--lua/aotrix/build.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/aotrix/build.lua b/lua/aotrix/build.lua
index ffd0bcd..af9e0ea 100644
--- a/lua/aotrix/build.lua
+++ b/lua/aotrix/build.lua
@@ -19,8 +19,8 @@ end
function writeJsonToFile(json, filePath)
local file, error = io.open(filePath, 'r')
- local content = file:read("*a")
if file ~= nil then
+ local content = file:read("*a")
local decoded_json = vim.json.decode(content)
print(decoded_json["first_element"])
end