Skip to content

Commit

Permalink
check if callback function is undefined or null.
Browse files Browse the repository at this point in the history
  • Loading branch information
b612lodger committed Dec 31, 2013
1 parent d790151 commit 3a1b14e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions WebViewBridge/assets/rpcStub.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ var rpcStub = (function(){
}

function handleSingleResponse(responseObj) {
if(callbackMap[responseObj.id] === undefined || callbackMap[responseObj.id] === null) {
return;
}
callbackMap[responseObj.id].call(contextMap[responseObj.id], responseObj.result);
callbackMap[responseObj.id] = undefined;
contextMap[responseObj.id] = undefined;
Expand Down

0 comments on commit 3a1b14e

Please sign in to comment.