]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix https://github.com/atom/electron/issues/3565 by adding a typeof
authorRyan Prichard <ryan.prichard@gmail.com>
Tue, 24 Nov 2015 22:49:52 +0000 (16:49 -0600)
committerRyan Prichard <ryan.prichard@gmail.com>
Tue, 24 Nov 2015 22:49:52 +0000 (16:49 -0600)
atom/browser/lib/rpc-server.coffee

index ce63d91896649623b5428f4762b4ac115c3147c6..d9b1047bc80789f49564c36b7576c0548c7ff113 100644 (file)
@@ -107,7 +107,7 @@ unwrapArgs = (sender, args) ->
 # style function and the caller didn't pass a callback.
 callFunction = (event, func, caller, args) ->
   funcMarkedAsync = v8Util.getHiddenValue(func, 'asynchronous')
-  funcPassedCallback = args[args.length - 1] is 'function'
+  funcPassedCallback = typeof args[args.length - 1] is 'function'
 
   try
     if funcMarkedAsync and not funcPassedCallback