title: App crashed when i select a photo from iCloud
body: <p>I am trying to fetch all photos from my device, and show them in a collection:</p>
  
  <pre><code>var allPhotos : PHFetchResult&lt;PHAsset&gt;? = nil  
  
  PHPhotoLibrary.requestAuthorization { status in
      switch status {
      case .authorized:
          let fetchOptions = PHFetchOptions()
          self.allPhotos = PHAsset.fetchAssets(with: .image, options: fetchOptions)
          print("Found \(allPhotos.count) assets")
      case .denied, .restricted:
          print("Not allowed")
      case .notDetermined:
          // Should not see this when requesting
          print("Not determined yet")
      }
  }
  </code></pre>
  
  <p>This code fetches all the photos from the device and as well as from iCloud and then stores them into <code>allPhotos</code> array. But when I am trying to set them using this function in collection view cell, I am only getting photos from the device. The other photos cell is empty. Converting images with this function:</p>
  
  <pre><code>func getUIImage(asset: PHAsset) -&gt; UIImage? {
  
      var img: UIImage?
      let manager = PHImageManager.default()
      let options = PHImageRequestOptions()
      options.version = .original
      options.isSynchronous = true
      manager.requestImageData(for: asset, options: options) { data, _, _, _ in
  
          if let data = data {
              img = UIImage(data: data)
          }
      }
      return img
  }
  </code></pre>
  
  <p>And for some images I am getting this error "Failed to load image data for asset " for those empty cells. Can someone explain why it is not fetching iCloud images?</p>