fix: image inside list flushes when loading more or in other situations

This commit is contained in:
pengfei.zhou
2022-06-02 14:40:04 +08:00
committed by osborn
parent 75151d57d4
commit 531e2d9298
7 changed files with 89 additions and 22 deletions

View File

@@ -25,7 +25,13 @@ @implementation DoricBundleResource
NSString *path = [self.bundle bundlePath];
NSString *fullPath = [path stringByAppendingPathComponent:self.identifier];
NSData *imgData = [[NSData alloc] initWithContentsOfFile:fullPath];
[result setupResult:imgData];
if (imgData) {
[result setupResult:imgData];
} else {
[result setupError:[NSException exceptionWithName:@"ResourceLoadError"
reason:@"Load resource error"
userInfo:nil]];
}
return result;
}
@end