aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Events
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-08-10 16:59:40 -0500
committerGitHub <noreply@github.com>2025-08-10 16:59:40 -0500
commit52cf12d65d55f6c7431c669991c7fd0cb130cc0f (patch)
tree66a1f8dd25cf23e3ab2b712c348f8657f1f9e37e /src/slskd/Events
parent2bb92971e5e6414ad1d01aaca92808cbfe96fc72 (diff)
parent9353755d0ee0f2764dcf6e5574758ee57ff73cd6 (diff)
downloadslskd-52cf12d65d55f6c7431c669991c7fd0cb130cc0f.tar.gz
Merge pull request #1418 from slskd/lists
Ensure lists stored as class property values are read only and properly materialized
Diffstat (limited to 'src/slskd/Events')
-rw-r--r--src/slskd/Events/EventService.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/slskd/Events/EventService.cs b/src/slskd/Events/EventService.cs
index d6f1a3f5..6dc61c13 100644
--- a/src/slskd/Events/EventService.cs
+++ b/src/slskd/Events/EventService.cs
@@ -48,7 +48,7 @@ public class EventService
/// <returns>The retrieved list.</returns>
/// <exception cref="ArgumentOutOfRangeException">Thrown when the specified <paramref name="offset"/> is less than zero.</exception>
/// <exception cref="ArgumentOutOfRangeException">Thrown when the specified <paramref name="limit"/> is zero.</exception>
- public virtual IReadOnlyCollection<EventRecord> Get(int offset = 0, int limit = int.MaxValue)
+ public virtual IReadOnlyList<EventRecord> Get(int offset = 0, int limit = int.MaxValue)
{
if (offset < 0)
{
@@ -68,7 +68,8 @@ public class EventService
.OrderByDescending(e => e.Timestamp)
.Skip(offset)
.Take(limit)
- .ToList();
+ .ToList()
+ .AsReadOnly();
return events;
}