Bug 1338544 - fix false positive for static analysis in Predictor::UpdateCacheability. r?valentin draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Fri, 10 Feb 2017 17:05:45 +0200
changeset 481865 f1ad0425c982feb988ceb37d80d17fc2471cd313
parent 481595 25a94c1047e793ef096d8556fa3c26dd72bd37d7
child 545297 8826ed2cef5c23686457b0df354b73cfb299e51c
push id44931
push userbmo:bpostelnicu@mozilla.com
push dateFri, 10 Feb 2017 15:07:38 +0000
reviewersvalentin
bugs1338544
milestone54.0a1
Bug 1338544 - fix false positive for static analysis in Predictor::UpdateCacheability. r?valentin MozReview-Commit-ID: 2HuqxEczm8H
netwerk/base/Predictor.cpp
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -2523,17 +2523,17 @@ void
 Predictor::UpdateCacheability(nsIURI *sourceURI, nsIURI *targetURI,
                               uint32_t httpStatus,
                               nsHttpRequestHead &requestHead,
                               nsHttpResponseHead *responseHead,
                               nsILoadContextInfo *lci)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (lci && lci->IsPrivate()) {
+  if (lci->IsPrivate()) {
     PREDICTOR_LOG(("Predictor::UpdateCacheability in PB mode - ignoring"));
     return;
   }
 
   if (!sourceURI || !targetURI) {
     PREDICTOR_LOG(("Predictor::UpdateCacheability missing source or target uri"));
     return;
   }