Updated GetSession to TryGetValue
parent
b9c18c5f75
commit
0662326da8
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue