Extra measure to avoid 0 units in transfer map

This commit is contained in:
Raffson 2023-03-18 22:10:22 +01:00
parent 0c6c578e35
commit 3060645a26
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -630,6 +630,8 @@ class PendingTransfers:
continue continue
size -= take size -= take
transfer.units[unit_type] -= take transfer.units[unit_type] -= take
if not transfer.units[unit_type]:
to_delete.append(unit_type)
units[unit_type] = take units[unit_type] = take
for td in to_delete: for td in to_delete:
del transfer.units[td] del transfer.units[td]