mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Ensure the callback is a function when executing JS
This commit is contained in:
committed by
Kevin Sawicki
parent
f549bda9fc
commit
095e79b043
@@ -115,8 +115,8 @@ const asyncWebFrameMethods = function (requestId, method, callback, ...args) {
|
||||
this.send('ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD', requestId, method, args)
|
||||
ipcMain.once(`ELECTRON_INTERNAL_BROWSER_ASYNC_WEB_FRAME_RESPONSE_${requestId}`, function (event, error, result) {
|
||||
if (error == null) {
|
||||
if (callback != null) callback(result)
|
||||
resolve(result)
|
||||
if (typeof callback === 'function') callback(result)
|
||||
} else {
|
||||
reject(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user