diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-09-28 13:22:37 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-09-28 13:22:37 +0000 |
commit | d3b3a6a1d683f1695cfbad3ba255dfc57dd2a7c4 (patch) | |
tree | e104aa392e55293954ca88e9a261c2b58a2060d0 | |
parent | e1f4c7588e1eb6253c3c1b0ee82205426fde19ec (diff) | |
download | acf-lib-d3b3a6a1d683f1695cfbad3ba255dfc57dd2a7c4.tar.bz2 acf-lib-d3b3a6a1d683f1695cfbad3ba255dfc57dd2a7c4.tar.xz |
Added null pointer check to format.get_ini_entry to avoid exception
-rw-r--r-- | format.lua | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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_]+") |