Marino Faggiana 7 years ago
parent
commit
04dfbc515f
1 changed files with 9 additions and 4 deletions
  1. 9 4
      iOSClient/ManageLocation+ManageAsset/NCRequestAsset.m

+ 9 - 4
iOSClient/ManageLocation+ManageAsset/NCRequestAsset.m

@@ -30,15 +30,17 @@
         return;
     }
 
-    PHAsset *asset = result[0];
-    PHAssetMediaType assetMediaType = asset.mediaType;
-    __block NSError *error = nil;
+    PHAsset *assetResult = result[0];
+    PHAssetMediaType assetMediaType = assetResult.mediaType;
     
     // VIDEO
     if (assetMediaType == PHAssetMediaTypeVideo) {
 
         @autoreleasepool {
-            
+        
+            __block PHAsset *asset = result[0];
+            __block NSError *error = nil;
+
             dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
 
             PHVideoRequestOptions *options = [PHVideoRequestOptions new];
@@ -122,6 +124,9 @@
         
         @autoreleasepool {
             
+            __block PHAsset *asset = result[0];
+            __block NSError *error = nil;
+        
             dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
             
             PHImageRequestOptions *options = [PHImageRequestOptions new];