bug 199756 : Crash at nsDocument::GetPrincipal

This commit is contained in:
hpradhan%hotpop.com 2003-03-31 15:45:44 +00:00
parent a8882e7d5a
commit 559976ba5f

View File

@ -873,8 +873,11 @@ NS_IMETHODIMP
nsDocument::AddPrincipal(nsIPrincipal *aNewPrincipal)
{
nsresult rv;
if (!mPrincipal)
GetPrincipal(nsnull);
if (!mPrincipal) {
nsCOMPtr<nsIPrincipal> principal;
rv = GetPrincipal(getter_AddRefs(principal));
NS_ENSURE_SUCCESS(rv, rv);
}
nsCOMPtr<nsIAggregatePrincipal> agg(do_QueryInterface(mPrincipal, &rv));
if (NS_SUCCEEDED(rv)) {