mirror of
https://github.com/akuker/RASCSI.git
synced 2025-07-14 08:24:27 +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:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user