Add check for array length
This commit is contained in:
parent
5a90c3ce20
commit
fba9a75d8a
@ -324,7 +324,7 @@ func (r *restream) resourceObserver(ctx context.Context, rsc resources.Resources
|
||||
defer t.Release(token)
|
||||
limitGPU := false
|
||||
gpuindex := t.GetHWDevice()
|
||||
if gpuindex >= 0 {
|
||||
if gpuindex >= 0 && len(limitGPUs) >= gpuindex+1 {
|
||||
limitGPU = limitGPUs[gpuindex]
|
||||
}
|
||||
if t.Limit(limitCPU, limitMemory, limitGPU) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user