From dad2a9254b8dc518a0ad04e1823d28071fac8231 Mon Sep 17 00:00:00 2001 From: sfeng Date: Mon, 15 Dec 2014 03:20:39 +0800 Subject: [PATCH] Bug fix:Collection <__NSArrayM: > was mutated while being enumerated --- SDWebImage/SDImageCache.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index 36bb751a..967421cd 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -248,7 +248,8 @@ BOOL ImageDataHasPNGPreffix(NSData *data) { return data; } - for (NSString *path in self.customPaths) { + NSArray *customPaths = [self.customPaths copy]; + for (NSString *path in customPaths) { NSString *filePath = [self cachePathForKey:key inPath:path]; NSData *imageData = [NSData dataWithContentsOfFile:filePath]; if (imageData) {