Updated GetSession to TryGetValue

pull/85/head
mullerj 2024-06-05 22:40:09 -04:00
parent b9c18c5f75
commit 0662326da8
1 changed files with 2 additions and 2 deletions

View File

@ -74,11 +74,11 @@ namespace Mil.Navy.Nrl.Norm
/// </summary> /// </summary>
/// <param name="handle">Specifies the session to return.</param> /// <param name="handle">Specifies the session to return.</param>
/// <returns>Returns a NormSession.</returns> /// <returns>Returns a NormSession.</returns>
internal static NormSession GetSession(long handle) internal static NormSession? GetSession(long handle)
{ {
lock (_normSessions) lock (_normSessions)
{ {
return _normSessions[handle]; return _normSessions.TryGetValue(handle, out NormSession? session) ? session : null;
} }
} }