Bug 625119: In icon-handling code, don't look up mimetype for empty file-extension. r=joe
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 29 Mar 2011 08:47:53 -0700
changeset 64139 fc1935dc39874c203c48e8ee3f80a8684360fbba
parent 64138 8fdd8b2b6b695f3815d6d232554378d39593510b
child 64140 23f36fd8b36eba90591688691e4973187f505326
push idunknown
push userunknown
push dateunknown
reviewersjoe
bugs625119
milestone2.2a1pre
Bug 625119: In icon-handling code, don't look up mimetype for empty file-extension. r=joe
modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
--- a/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
+++ b/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
@@ -368,17 +368,19 @@ nsIconChannel::InitWithGnome(nsIMozIconU
   }
 
 
   if (type.IsEmpty()) {
     nsCOMPtr<nsIMIMEService> ms(do_GetService("@mozilla.org/mime;1"));
     if (ms) {
       nsCAutoString fileExt;
       aIconURI->GetFileExtension(fileExt);
-      ms->GetTypeFromExtension(fileExt, type);
+      if (!fileExt.IsEmpty()) {
+        ms->GetTypeFromExtension(fileExt, type);
+      }
     }
   }
   // Get the icon theme
   if (!gIconTheme) {
     gIconTheme = _gnome_icon_theme_new();
 
     if (!gIconTheme) {
       _gnome_vfs_file_info_clear(&fileInfo);