diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-03 21:48:59 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-03 21:48:59 -0500 |
| commit | 54b0de8d76d383dcd32cb0a485e6222fb50b783f (patch) | |
| tree | 0107cdae295707ea7bf9c26e26ec1aa29aa8ed83 /src | |
| parent | 3b76fbbf168d2ec9798f36ac8be6beda8675e022 (diff) | |
| download | slskd-54b0de8d76d383dcd32cb0a485e6222fb50b783f.tar.gz | |
throw if we can't find a users group
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Transfers/Uploads/UploadQueue.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/slskd/Transfers/Uploads/UploadQueue.cs b/src/slskd/Transfers/Uploads/UploadQueue.cs index 2494f5c1..1cefe74f 100644 --- a/src/slskd/Transfers/Uploads/UploadQueue.cs +++ b/src/slskd/Transfers/Uploads/UploadQueue.cs @@ -419,8 +419,14 @@ namespace slskd.Transfers.Uploads } // the Uploads dictionary is keyed by username; gather all of the users that belong to the same group as the requested user + // a user's group can change either by user changing the config or updating counts (for leech detection); resist the urge to cache this var uploadsForGroup = UploadDictionary.Where(kvp => Users.GetGroup(kvp.Key) == groupName); + if (groupRecord is null) + { + throw new SlskdException($"Upload group {groupName} doesn't have an entry in upload dictionary. Please report this on GitHub: {Program.IssuesUrl}"); + } + // assuming that the queue will be processed in a true round-robin fashion and that the user will be the last in the // rotation (worst case), the user's start position will be equal to the number of users downloading or waiting, + 1. if (groupRecord.Strategy == QueueStrategy.RoundRobin) |
