Skip to content

Commit

Permalink
fix: correctly return properties on the netLog module (#17544)
Browse files Browse the repository at this point in the history
  • Loading branch information
trop[bot] authored and MarshallOfSound committed Mar 27, 2019
1 parent 36965a6 commit c6fd15e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/browser/api/net-log.js
Expand Up @@ -10,8 +10,12 @@ Object.setPrototypeOf(module.exports, new Proxy({}, {
if (!app.isReady()) return

const netLog = session.defaultSession.netLog

if (!Object.getPrototypeOf(netLog).hasOwnProperty(property)) return

// check for properties on the prototype chain that aren't functions
if (typeof netLog[property] !== 'function') return netLog[property]

// Returning a native function directly would throw error.
return (...args) => netLog[property](...args)
},
Expand Down

0 comments on commit c6fd15e

Please sign in to comment.