Skip to content

Commit

Permalink
[FIX] Session data semantics have changed by not using DataDictionary…
Browse files Browse the repository at this point in the history
… any more.
  • Loading branch information
rdeago authored and geoperez committed Feb 12, 2020
1 parent cc2f587 commit 24256dd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/EmbedIO/Sessions/LocalSessionManager.SessionImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,23 @@ public bool IsEmpty
}
}

public object this[string key]
public object? this[string key]
{
get
{
lock (_data)
{
return _data[key];
return _data.TryGetValue(key, out var value) ? value : null;
}
}
set
{
lock (_data)
{
_data[key] = value;
if (value == null)
_data.Remove(key);
else
_data[key] = value;
}
}
}
Expand Down

0 comments on commit 24256dd

Please sign in to comment.