Bug 1313639 - null check fwdobject in nsahttpconnection r=dragana
authorPatrick McManus <mcmanus@ducksong.com>
Fri, 28 Oct 2016 10:22:35 -0400
changeset 346654 b05eb6590d71d53d564534cb0f3c8bcf08b826cf
parent 346653 b5ad7d04ed432709e739174b6f9671e2945b973c
child 346655 8f89f06bdb13ae1574dac84a8b56e5d9db4ba6c9
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana
bugs1313639
milestone52.0a1
Bug 1313639 - null check fwdobject in nsahttpconnection r=dragana
netwerk/protocol/http/nsAHttpConnection.h
--- a/netwerk/protocol/http/nsAHttpConnection.h
+++ b/netwerk/protocol/http/nsAHttpConnection.h
@@ -223,32 +223,35 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsAHttpCon
     uint32_t Version() override        \
     {                                      \
         return (fwdObject) ?               \
             (fwdObject)->Version() :       \
             NS_HTTP_VERSION_UNKNOWN;       \
     }                                      \
     bool IsProxyConnectInProgress() override                \
     {                                                       \
-        return (fwdObject)->IsProxyConnectInProgress();     \
+        return (!fwdObject) ? false :                       \
+               (fwdObject)->IsProxyConnectInProgress();     \
     }                                                       \
     bool LastTransactionExpectedNoContent() override        \
     {                                                       \
-        return (fwdObject)->LastTransactionExpectedNoContent(); \
+        return (!fwdObject) ? false :                       \
+        (fwdObject)->LastTransactionExpectedNoContent();    \
     }                                                       \
     void SetLastTransactionExpectedNoContent(bool val)      \
       override                                              \
     {                                                       \
-        return (fwdObject)->SetLastTransactionExpectedNoContent(val); \
+      if (fwdObject)                                        \
+        (fwdObject)->SetLastTransactionExpectedNoContent(val); \
     }                                                       \
     void Classify(nsAHttpTransaction::Classifier newclass)  \
       override                                              \
     {                                                       \
     if (fwdObject)                                          \
-        return (fwdObject)->Classify(newclass);             \
+        (fwdObject)->Classify(newclass);                    \
     }                                                       \
     int64_t BytesWritten() override                         \
     {     return fwdObject ? (fwdObject)->BytesWritten() : 0; } \
     void SetSecurityCallbacks(nsIInterfaceRequestor* aCallbacks) \
       override                                              \
     {                                                       \
         if (fwdObject)                                      \
             (fwdObject)->SetSecurityCallbacks(aCallbacks);  \