You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/01/23 18:36:26 UTC

ios commit: Don't send callbacks when there are no listeners.

Updated Branches:
  refs/heads/master db2276836 -> 3dae6139a


Don't send callbacks when there are no listeners.


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/3dae6139
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/3dae6139
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/3dae6139

Branch: refs/heads/master
Commit: 3dae6139aa606b621217789ead4ab2131c3c82e2
Parents: db22768
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Jan 23 12:35:05 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Jan 23 12:35:05 2013 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVCommandDelegateImpl.m |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3dae6139/CordovaLib/Classes/CDVCommandDelegateImpl.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCommandDelegateImpl.m b/CordovaLib/Classes/CDVCommandDelegateImpl.m
index 3447111..8845e40 100644
--- a/CordovaLib/Classes/CDVCommandDelegateImpl.m
+++ b/CordovaLib/Classes/CDVCommandDelegateImpl.m
@@ -78,6 +78,10 @@
 
 - (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId
 {
+    // This occurs when there is are no win/fail callbacks for the call.
+    if ([@"INVALID" isEqualToString:callbackId]) {
+        return;
+    }
     int status = [result.status intValue];
     BOOL keepCallback = [result.keepCallback boolValue];
     id message = result.message == nil ? [NSNull null] : result.message;