Camino only - Bug 394772: Catch exceptions loading damaged favicons from cache. r/sr=pink

git-svn-id: svn://10.0.0.236/trunk@236306 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
stuart.morgan%alumni.case.edu
2007-09-19 16:22:58 +00:00
parent 7509606b87
commit 47f0973428

View File

@@ -118,7 +118,13 @@ static NSString* const kCacheEntryExpirationDateKey = @"exp_date";
if (imageUUID)
{
cachedImage = [NSKeyedUnarchiver unarchiveObjectWithFile:[self imageDataFileWithUUID:imageUUID]];
// Damaged files may raise exceptions when we try to unarchive.
@try {
cachedImage = [NSKeyedUnarchiver unarchiveObjectWithFile:[self imageDataFileWithUUID:imageUUID]];
}
@catch (id exception) {
// nothing to do here; cleanup of the damage file happens below
}
if (cachedImage)
{
// if we got the image, keep it in the memory cache