From 47f0973428941cd924e980d7a2a80fadc0d7d88f Mon Sep 17 00:00:00 2001 From: "stuart.morgan%alumni.case.edu" Date: Wed, 19 Sep 2007 16:22:58 +0000 Subject: [PATCH] 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 --- mozilla/camino/src/browser/SiteIconCache.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/camino/src/browser/SiteIconCache.mm b/mozilla/camino/src/browser/SiteIconCache.mm index 81dfe21eb87..c550e811daa 100644 --- a/mozilla/camino/src/browser/SiteIconCache.mm +++ b/mozilla/camino/src/browser/SiteIconCache.mm @@ -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