Bug 1352348 - don't do registry lookups for empty strings passed when we want to know a mimetype, r?paolo
MozReview-Commit-ID: KZ9w7zMZ35g
--- a/uriloader/exthandler/win/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/win/nsOSHelperAppService.cpp
@@ -499,17 +499,18 @@ already_AddRefed<nsIMIMEInfo> nsOSHelper
/* XXX The Equals is a gross hack to wallpaper over the most common Win32
* extension issues caused by the fix for bug 116938. See bug
* 120327, comment 271 for why this is needed. Not even sure we
* want to remove this once we have fixed all this stuff to work
* right; any info we get from the OS on this type is pretty much
* useless....
* We'll do extension-based lookup for this type later in this function.
*/
- if (!aMIMEType.LowerCaseEqualsLiteral(APPLICATION_OCTET_STREAM)) {
+ if (!aMIMEType.IsEmpty() &&
+ !aMIMEType.LowerCaseEqualsLiteral(APPLICATION_OCTET_STREAM)) {
// (1) try to use the windows mime database to see if there is a mapping to a file extension
// (2) try to see if we have some left over 4.x registry info we can peek at...
GetExtensionFromWindowsMimeDatabase(aMIMEType, fileExtension);
LOG(("Windows mime database: extension '%s'\n", fileExtension.get()));
if (fileExtension.IsEmpty()) {
GetExtensionFrom4xRegistryInfo(aMIMEType, fileExtension);
LOG(("4.x Registry: extension '%s'\n", fileExtension.get()));
}