aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-04 17:45:30 -0500
committerJP Dillingham <jp@dillingham.me>2026-10-04 17:45:30 -0500
commit67999bda3007baf735b5a14926c1b6e4c22e4a55 (patch)
treec041518c48897f6453ab5d8d053b9d87a1ec789b /src
parent49137b53c9dafc0c4b533fcab547fedc9e9e0370 (diff)
downloadslskd-67999bda3007baf735b5a14926c1b6e4c22e4a55.tar.gz
fail loudly if groups desync
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Transfers/Uploads/UploadQueue.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/slskd/Transfers/Uploads/UploadQueue.cs b/src/slskd/Transfers/Uploads/UploadQueue.cs
index 42d70194..ccd1f5f2 100644
--- a/src/slskd/Transfers/Uploads/UploadQueue.cs
+++ b/src/slskd/Transfers/Uploads/UploadQueue.cs
@@ -306,7 +306,11 @@ namespace slskd.Transfers.Uploads
public int EstimatePosition(string username, string filename)
{
var groupName = Users.GetGroup(username);
- var groupRecord = Groups.GetValueOrDefault(groupName);
+
+ if (!Groups.TryGetValue(groupName, out var groupRecord))
+ {
+ throw new SlskdException($"Upload group {groupName} doesn't have an entry in upload dictionary. Please report this on GitHub: {Program.IssuesUrl}");
+ }
// 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