Author: psutter
Date: Fri Jul 21 08:02:01 2017
New Revision: 1802552

URL: http://svn.apache.org/viewvc?rev=1802552&view=rev
Log:
CMIS-1040 Fix issues found with static analyzer

Modified:
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m
    chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m

Modified: 
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m
URL: 
http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m?rev=1802552&r1=1802551&r2=1802552&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m 
(original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISObjectConverter.m Fri 
Jul 21 08:02:01 2017
@@ -86,11 +86,15 @@
             } else {
                 if (position == 0) {
                     NSMutableArray *objects = [[NSMutableArray alloc] 
initWithCapacity:objectDatas.count];
-                    [objects addObject:object];
+                    if (object != nil) {
+                        [objects addObject:object];
+                    }
                     completionBlock(objects, error);
                 } else {
                     [self internalConvertObject:objectDatas position:(position 
- 1) completionBlock:^(NSMutableArray *objects, NSError *error) {
-                        [objects addObject:object];
+                        if (object != nil) {
+                            [objects addObject:object];
+                        }
                         completionBlock(objects, error);
                     }];
                 }

Modified: chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m
URL: 
http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m?rev=1802552&r1=1802551&r2=1802552&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m 
(original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m Fri 
Jul 21 08:02:01 2017
@@ -2164,7 +2164,7 @@
                  }
              }
              XCTAssertNotNil(thumbnailRendition, @"Thumbnail rendition should 
be availabile");
-             XCTAssertTrue(thumbnailRendition.length > 0, @"Rendition length 
should be greater than 0");
+             XCTAssertTrue([thumbnailRendition.length integerValue] > 0, 
@"Rendition length should be greater than 0");
              
              // Get content
              NSString *filePath = [NSString 
stringWithFormat:@"%@/testfile.pdf" , NSTemporaryDirectory()];
@@ -2218,7 +2218,7 @@
                       }
                   }
                   XCTAssertNotNil(thumbnailRendition, @"Thumbnail rendition 
should be availabile");
-                  XCTAssertTrue(thumbnailRendition.length > 0, @"Rendition 
length should be greater than 0");
+                  XCTAssertTrue([thumbnailRendition.length integerValue] > 0, 
@"Rendition length should be greater than 0");
                   
                   // Download content through objectService
                   NSString *filePath = [NSString 
stringWithFormat:@"%@/testfile-rendition-through-objectservice.pdf", 
NSTemporaryDirectory()];


Reply via email to