 			return
 		}
 		
-        guard let lastResult = group.fetchResult.lastObject else {
+        guard let lastResult = group.fetchResult?.lastObject else {
             assertionFailure("Expect latestAsset")
             completeBlock(nil, nil)
             return

        }
        
        if (insertedGroupIds.count > 0) {
            self.notify(with: #selector(DKImageGroupDataManagerObserver.groupsDidInsert(groupIds:)), object: insertedGroupIds as AnyObject)
        }
    }
}

        latestAsset.fetchImage(with: size, options: options, completeBlock: completeBlock)
	}
	
	open func fetchAsset(_ group: DKAssetGroup, index: Int) -> DKAsset? {
        guard let phAsset = fetchPHAsset(group, index: index) else {
            assertionFailure("Expect phAsset")
            return nil
        }

        if let asset = assets[phAsset.localIdentifier] {
            return asset
        }

        let asset = DKAsset(originalAsset: phAsset)
        assets[phAsset.localIdentifier] = asset
        return asset
	}
    
    open func fetchPHAsset(_ group: DKAssetGroup, index: Int) -> PHAsset? {
        guard let fetchResult = group.fetchResult else {
            assertionFailure("Expect fetchResult")
            return nil
        }
        let idx = fetchResult.count - 1 - index
        guard idx >= 0 && fetchResult.count > idx else {
            assertionFailure("idx out of range:\(idx) fetchResult count:\(fetchResult.count)")
            return nil
        }
        return fetchResult[idx]
    }
    
    open func makeDKAssetGroup(with collection: PHAssetCollection) -> DKAssetGroup {
        let assetGroup = DKAssetGroup(groupId: collection.localIdentifier ?? "")

        self.updateGroup(assetGroup, collection: collection)

        let fetchResult = PHAsset.fetchAssets(in: collection,
                                              options: self.configuration.assetFetchOptions)
        self.updateGroup(assetGroup, fetchResult: fetchResult)

        return assetGroup
    }
    
