Eliminate a crash for all platforms without IconDatabase hooked up
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Sep 2006 19:01:36 +0000 (19:01 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Sep 2006 19:01:36 +0000 (19:01 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16499 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/Frame.cpp

index cb7cecf94a2c256d11296f7f26a2a0c96b07a4aa..ac020c4a8273dae8f9dd73e8c3a972f076515f45 100644 (file)
@@ -1,3 +1,13 @@
+2006-09-21  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders
+
+        When your assumption is "IconDatabase::sharedIconDatabase()" will never fail but it does, you're in trouble
+        This fixes Spinneret so it won't crash on its first load!
+
+        * page/Frame.cpp:
+        (WebCore::Frame::endIfNotLoading):
+
 2006-09-21  Brady Eidson  <beidson@apple.com>
 
         Build fix
index e87841f16ece2c11d1c3e4c07dbfe147d3761b3e..7b4cc35fba535c765c5ff2e2a881e8e6471c9953 100644 (file)
@@ -765,23 +765,25 @@ void Frame::endIfNotLoading()
     if (tree()->parent())
         return;
         
-    IconDatabase* sharedIconDatabase = IconDatabase::sharedIconDatabase();
-    if (!sharedIconDatabase->enabled())
-        return;
-    
-    String url(iconURL().url());
-    if (url.isEmpty())
-        return;
     
-    // If we already have an unexpired icon, we won't kick off a load but we *will* map the appropriate URLs to it
-    if (sharedIconDatabase->hasEntryForIconURL(url) && !isLoadTypeReload() && !sharedIconDatabase->isIconExpiredForIconURL(url)) {
-        commitIconURLToIconDatabase();
-        return;
+    if (IconDatabase* sharedIconDatabase = IconDatabase::sharedIconDatabase()) {
+        if (!sharedIconDatabase->enabled())
+            return;
+        
+        String url(iconURL().url());
+        if (url.isEmpty())
+            return;
+        
+        // If we already have an unexpired icon, we won't kick off a load but we *will* map the appropriate URLs to it
+        if (sharedIconDatabase->hasEntryForIconURL(url) && !isLoadTypeReload() && !sharedIconDatabase->isIconExpiredForIconURL(url)) {
+            commitIconURLToIconDatabase();
+            return;
+        }
+        
+        if (!d->m_iconLoader)
+            d->m_iconLoader = IconLoader::createForFrame(this);
+        d->m_iconLoader->startLoading();
     }
-    
-    if (!d->m_iconLoader)
-        d->m_iconLoader = IconLoader::createForFrame(this);
-    d->m_iconLoader->startLoading();
 }
 
 void Frame::commitIconURLToIconDatabase()