incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From becka...@apache.org
Subject ios commit: Fixes CB-977 - MediaFile.getFormatData failing
Date Thu, 28 Jun 2012 20:07:41 GMT
Updated Branches:
  refs/heads/master b6f02dea2 -> 9daddd1ee


Fixes CB-977 - MediaFile.getFormatData failing

Unified cordova JS now passes in NSNull for null parameters where
previously they were ignored.  This was causing getFormatData to fail
when MediaFile.type was null.


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

Branch: refs/heads/master
Commit: 9daddd1ee46280a923c220fc39b5b766ef121395
Parents: b6f02de
Author: Becky Gibson <becka11y@apache.org>
Authored: Thu Jun 28 15:59:21 2012 -0400
Committer: Becky Gibson <becka11y@apache.org>
Committed: Thu Jun 28 16:04:57 2012 -0400

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


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/9daddd1e/CordovaLib/Classes/CDVCapture.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCapture.m b/CordovaLib/Classes/CDVCapture.m
index 694aea2..7155cb0 100644
--- a/CordovaLib/Classes/CDVCapture.m
+++ b/CordovaLib/Classes/CDVCapture.m
@@ -349,7 +349,7 @@
     NSString* callbackId = [arguments objectAtIndex:0];
     // existence of fullPath checked on JS side
     NSString* fullPath = [arguments objectAtIndex:1];
-    // mimeType could be empty/null
+    // mimeType could be null
     NSString* mimeType = nil;
     if ([arguments count] > 2) {
         mimeType = [arguments objectAtIndex:2];
@@ -359,7 +359,7 @@
     CDVPluginResult* result = nil;
     NSString* jsString = nil;
     
-    if (!mimeType){
+    if (!mimeType || [mimeType isKindOfClass: [NSNull class]]){
         // try to determine mime type if not provided
         id command = [self.commandDelegate getCommandInstance: @"File"];
         bError = !([command isKindOfClass:[CDVFile class]]);


Mime
View raw message