diff --git a/mozilla/modules/libjar/nsJARChannel.cpp b/mozilla/modules/libjar/nsJARChannel.cpp index ee2244b5e6a..550db4e440a 100644 --- a/mozilla/modules/libjar/nsJARChannel.cpp +++ b/mozilla/modules/libjar/nsJARChannel.cpp @@ -449,7 +449,7 @@ nsJARChannel::EnsureJARFileAvailable(OnJARFileAvailableFun onJARFileAvailable, if (NS_FAILED(rv)) goto error; rv = jarBaseChannel->GetLocalFile(getter_AddRefs(jarCacheFile)); - if (NS_SUCCEEDED(rv)) { + if (NS_SUCCEEDED(rv) && jarCacheFile) { // Case 1: Local file // we've already got a local jar file -- no need to download it diff --git a/mozilla/modules/libjar/nsJARURI.cpp b/mozilla/modules/libjar/nsJARURI.cpp index 98e8fb74e41..34ef86d3bec 100644 --- a/mozilla/modules/libjar/nsJARURI.cpp +++ b/mozilla/modules/libjar/nsJARURI.cpp @@ -243,6 +243,9 @@ nsJARURI::Equals(nsIURI *other, PRBool *result) nsresult rv; *result = PR_FALSE; + if (other == nsnull) + return NS_OK; // not equal + nsJARURI* otherJAR; rv = other->QueryInterface(NS_GET_IID(nsIJARURI), (void**)&otherJAR); if (NS_FAILED(rv)) diff --git a/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp b/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp index ee2244b5e6a..550db4e440a 100644 --- a/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp +++ b/mozilla/netwerk/protocol/jar/src/nsJARChannel.cpp @@ -449,7 +449,7 @@ nsJARChannel::EnsureJARFileAvailable(OnJARFileAvailableFun onJARFileAvailable, if (NS_FAILED(rv)) goto error; rv = jarBaseChannel->GetLocalFile(getter_AddRefs(jarCacheFile)); - if (NS_SUCCEEDED(rv)) { + if (NS_SUCCEEDED(rv) && jarCacheFile) { // Case 1: Local file // we've already got a local jar file -- no need to download it diff --git a/mozilla/netwerk/protocol/jar/src/nsJARURI.cpp b/mozilla/netwerk/protocol/jar/src/nsJARURI.cpp index 98e8fb74e41..34ef86d3bec 100644 --- a/mozilla/netwerk/protocol/jar/src/nsJARURI.cpp +++ b/mozilla/netwerk/protocol/jar/src/nsJARURI.cpp @@ -243,6 +243,9 @@ nsJARURI::Equals(nsIURI *other, PRBool *result) nsresult rv; *result = PR_FALSE; + if (other == nsnull) + return NS_OK; // not equal + nsJARURI* otherJAR; rv = other->QueryInterface(NS_GET_IID(nsIJARURI), (void**)&otherJAR); if (NS_FAILED(rv))