If we have an unsupported classid, bail out even if we have no URI. Bug

363379, r+sr=biesi
This commit is contained in:
bzbarsky@mit.edu
2006-12-19 16:31:42 +00:00
parent 180767e149
commit 53ffd16464

View File

@@ -904,6 +904,14 @@ nsObjectLoadingContent::LoadObject(nsIURI* aURI,
isSupportedClassID = NS_SUCCEEDED(TypeForClassID(classid, typeForID));
}
}
if (hasID && !isSupportedClassID) {
// We have a class ID and it's unsupported. Fallback in that case.
LOG(("OBJLC [%p]: invalid classid\n", this));
rv = NS_ERROR_NOT_AVAILABLE;
return NS_OK;
}
if (isSupportedClassID ||
(!aURI && !aTypeHint.IsEmpty() &&
GetTypeOfContent(aTypeHint) == eType_Plugin)) {
@@ -938,13 +946,6 @@ nsObjectLoadingContent::LoadObject(nsIURI* aURI,
rv = Instantiate(mContentType, mURI);
return NS_OK;
}
// If we get here, and we had a class ID, then it must have been unsupported.
// Fallback in that case.
if (hasID) {
LOG(("OBJLC [%p]: invalid classid\n", this));
rv = NS_ERROR_NOT_AVAILABLE;
return NS_OK;
}
if (!aURI) {
// No URI and no type... nothing we can do.