diff --git a/injector.js b/injector.js index 30b93ce..3ba5915 100644 --- a/injector.js +++ b/injector.js @@ -1,4 +1,4 @@ -globalThis.ModAPIVersion = "v2.7"; +globalThis.ModAPIVersion = "v2.7.1"; globalThis.doEaglerforge = true; document.querySelector("title").innerText = `EaglerForge Injector ${ModAPIVersion}`; document.querySelector("h1").innerText = `EaglerForge Injector ${ModAPIVersion}`; diff --git a/postinit.js b/postinit.js index 53b8868..074db62 100644 --- a/postinit.js +++ b/postinit.js @@ -771,7 +771,7 @@ globalThis.modapi_postinit = "(" + (() => { if (!object) { return null; } - if (prop in object) { + if ((prop in object) && Object.keys(object).includes(prop)) { return prop; } var possibleKeys = Object.keys(object).filter(x => { return x.startsWith(prop) }); @@ -780,7 +780,7 @@ globalThis.modapi_postinit = "(" + (() => { }) return possibleKeys.sort((a, b) => { return a.length - b.length; - })[0] || null; + })[0] || prop; } ModAPI.util.modifyFunction = function (fn, patcherFn) {