diff options
author | cracyc <cracyc@users.noreply.github.com> | 2017-06-03 12:35:17 -0500 |
---|---|---|
committer | cracyc <cracyc@users.noreply.github.com> | 2017-06-03 12:35:17 -0500 |
commit | 247f72309488746e6406f2561cb66dfab326c0a4 (patch) | |
tree | 7f1a1a8d77e5750a1f964171509cef75a0dc823c | |
parent | 78614368bf1b03da5c9b0d111c33518204f45527 (diff) |
plugins/cheat: oops (nw)
-rw-r--r-- | plugins/cheat/init.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index 1990fbca86a..65e7cd2eeb3 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -113,7 +113,11 @@ function cheat.startplugin() local function load_hotkeys() local json = require("json") - local hotkeys = json.parse(io.open(manager:machine():options().entries.cheatpath:value():match("([^;]+)") .. "/" .. cheatname .. "_hotkeys.json", "r"):read("a")) + local file = io.open(manager:machine():options().entries.cheatpath:value():match("([^;]+)") .. "/" .. cheatname .. "_hotkeys.json", "r") + if not file then + return + end + local hotkeys = json.parse(file:read("a")) for num, val in ipairs(hotkeys) do for num, cheat in pairs(cheats) do if val.desc == cheat.desc then |