diff options
author | AppaRao Puli <apparao.puli@linux.intel.com> | 2020-07-23 22:27:12 +0300 |
---|---|---|
committer | AppaRao Puli <apparao.puli@linux.intel.com> | 2020-07-23 23:07:33 +0300 |
commit | 62de0c68e793c694d9bb2386e837efe7320cced0 (patch) | |
tree | 2fa9bbde5d98a72bda5a07fd7ce87b7c9ce0b5ec | |
parent | f6a0d638eb590e37df2e73022edd29c256a0db8b (diff) | |
download | bmcweb-62de0c68e793c694d9bb2386e837efe7320cced0.tar.xz |
EventService: Add nullptr check to avoid crash
Subscribing for events using SSE subscription
type is crashing the bmcweb. Add nullptr check
around the connection object which is created for
'Push Style Events', to avoid the crash in case
of SSE.
Tested:
- SSE subscription works fine and crash goes way.
- 'Push style event' works fine.
Change-Id: I8ad5b63ca5a82d7ffe41054eee5f4ab6dcb9d72f
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
-rw-r--r-- | redfish-core/include/event_service_manager.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp index 6362112b5d..d2f4f2acc7 100644 --- a/redfish-core/include/event_service_manager.hpp +++ b/redfish-core/include/event_service_manager.hpp @@ -553,12 +553,18 @@ class Subscription void updateRetryConfig(const uint32_t retryAttempts, const uint32_t retryTimeoutInterval) { - conn->setRetryConfig(retryAttempts, retryTimeoutInterval); + if (conn != nullptr) + { + conn->setRetryConfig(retryAttempts, retryTimeoutInterval); + } } void updateRetryPolicy() { - conn->setRetryPolicy(retryPolicy); + if (conn != nullptr) + { + conn->setRetryPolicy(retryPolicy); + } } private: |