Bug 1313639 - null check fwdobject in nsahttpconnection r=dragana
authorPatrick McManus <mcmanus@ducksong.com>
Fri, 28 Oct 2016 10:22:35 -0400
changeset 320024 b05eb6590d71d53d564534cb0f3c8bcf08b826cf
parent 320023 b5ad7d04ed432709e739174b6f9671e2945b973c
child 320025 8f89f06bdb13ae1574dac84a8b56e5d9db4ba6c9
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [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);  \