mirror of
https://github.com/akuker/RASCSI.git
synced 2025-02-16 19:31:09 +00:00
In case all IDs are reserved recommend 0
Otherwise the occupied list is empty and this exception brings down the whole web interface. This can be easily provoked by just reserving all IDs in the web interface.
This commit is contained in:
parent
348b5dd026
commit
a33a228b6b
@ -32,7 +32,10 @@ def get_valid_scsi_ids(devices, reserved_ids):
|
||||
if unoccupied_ids:
|
||||
recommended_id = unoccupied_ids[-1]
|
||||
else:
|
||||
recommended_id = occupied_ids.pop(0)
|
||||
if occupied_ids:
|
||||
recommended_id = occupied_ids.pop(0)
|
||||
else:
|
||||
recommended_id = 0
|
||||
|
||||
return valid_ids, recommended_id
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user