2008-08-08 Brady Eidson <beidson@apple.com>
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Aug 2008 18:48:26 +0000 (18:48 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Aug 2008 18:48:26 +0000 (18:48 +0000)
        Reviewed by Sam Weinig

        Fix for <rdar://problem/5865504>

        This bug was actually *largely* fixed by http://trac.webkit.org/changeset/35538.
        But with that same patch, it became possible for a WebResource to fail to initialize.
        Therefore we were trying to add nil to an NSCFArray for certain situations, which is bad.
        Lets fix that, shall we?

        * WebView/WebArchive.mm:
        (-[WebArchive subresources]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35643 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/mac/ChangeLog
WebKit/mac/WebView/WebArchive.mm

index cd97d10..06a0cd6 100644 (file)
@@ -1,3 +1,17 @@
+2008-08-08  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Sam Weinig
+
+        Fix for <rdar://problem/5865504>
+
+        This bug was actually *largely* fixed by http://trac.webkit.org/changeset/35538.
+        But with that same patch, it became possible for a WebResource to fail to initialize.  
+        Therefore we were trying to add nil to an NSCFArray for certain situations, which is bad.
+        Lets fix that, shall we?
+
+        * WebView/WebArchive.mm:
+        (-[WebArchive subresources]): 
+
 2008-08-06  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Cameron Zwarich.
index 55edbd8..c989a9a 100644 (file)
@@ -296,8 +296,10 @@ static BOOL isArrayOfClass(id object, Class elementClass)
             _private->cachedSubresources = mutableArray;
             for (unsigned i = 0; i < subresources.size(); ++i) {
                 WebResource *resource = [[WebResource alloc] _initWithCoreResource:subresources[i].get()];
-                [mutableArray addObject:resource];
-                [resource release];
+                if (resource) {
+                    [mutableArray addObject:resource];
+                    [resource release];
+                }
             }
         }
     }