Guard against missing members in setObjectMembers
This commit is contained in:
parent
cb0845fc49
commit
5167ccd147
1 changed files with 3 additions and 3 deletions
|
@ -95,6 +95,8 @@ const wrapArgs = function (args, visited) {
|
|||
// The |ref| will be kept referenced by |members|.
|
||||
// This matches |getObjectMemebers| in rpc-server.
|
||||
const setObjectMembers = function (ref, object, metaId, members) {
|
||||
if (!Array.isArray(members)) return
|
||||
|
||||
for (let member of members) {
|
||||
if (object.hasOwnProperty(member.name)) continue
|
||||
|
||||
|
@ -161,10 +163,8 @@ const proxyFunctionProperties = function (remoteMemberFunction, metaId, name) {
|
|||
if (loaded) return
|
||||
loaded = true
|
||||
const meta = ipcRenderer.sendSync('ELECTRON_BROWSER_MEMBER_GET', metaId, name)
|
||||
if (Array.isArray(meta.members)) {
|
||||
setObjectMembers(remoteMemberFunction, remoteMemberFunction, meta.id, meta.members)
|
||||
}
|
||||
}
|
||||
|
||||
return new Proxy(remoteMemberFunction, {
|
||||
set: (target, property, value, receiver) => {
|
||||
|
|
Loading…
Reference in a new issue