[Patcher > Base] Make key value check type strict instead of existing

pull/67/head
Oj18 2 years ago
parent fa29ca2c83
commit 821b693554

@ -79,8 +79,8 @@ const generateNewFunction = (originalFunction, id, functionName, keyName) => (fu
});
export const patch = (parent, functionName, handler, before = false) => {
if (!parent[functionName]) {
goosemod.logger.debug('patcher', 'Failed to patch as key doesn\'t exist', parent, functionName);
if (typeof parent[functionName] !== 'function') {
goosemod.logger.debug('patcher', 'Failed to patch as key isn\'t func', parent, functionName);
return () => {}; // Stub func to not break
}

Loading…
Cancel
Save