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>
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 6362112..d2f4f2a 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -553,12 +553,18 @@
     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: