diff options
-rw-r--r-- | redfish-core/lib/redfish_sessions.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp index e4eae68c33..af01e05af7 100644 --- a/redfish-core/lib/redfish_sessions.hpp +++ b/redfish-core/lib/redfish_sessions.hpp @@ -215,6 +215,12 @@ inline void handleSessionCollectionPost( persistent_data::SessionStore::getInstance().generateUserSession( username, req.ipAddress, clientId, persistent_data::PersistenceType::TIMEOUT, isConfigureSelfOnly); + if (session == nullptr) + { + messages::internalError(asyncResp->res); + return; + } + asyncResp->res.addHeader("X-Auth-Token", session->sessionToken); asyncResp->res.addHeader( "Location", "/redfish/v1/SessionService/Sessions/" + session->uniqueId); |