From 247f72309488746e6406f2561cb66dfab326c0a4 Mon Sep 17 00:00:00 2001 From: cracyc Date: Sat, 3 Jun 2017 12:35:17 -0500 Subject: plugins/cheat: oops (nw) --- plugins/cheat/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3