summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--format.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/format.lua b/format.lua
index fc46e36..e97e6f4 100644
--- a/format.lua
+++ b/format.lua
@@ -496,10 +496,17 @@ function get_ini_entry (file, section, value)
opts = parse_ini_file(file)
end
section = section or ""
- local result = opts[section][value]
+ local result
+ if opts and opts[section] then
+ result = opts[section][value]
+ end
if not result then
section = ""
- result = opts[section][value] or ""
+ if opts and opts[section] then
+ result = opts[section][value] or ""
+ else
+ result = ""
+ end
end
while string.find(result, "%$[%w_]+") do
local sub = string.match(result, "%$[%w_]+")