From aa3a5b4978dc5c9e35442b26641e0ad0270bb2d3 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 31 Oct 2024 12:17:53 +0100 Subject: [PATCH] Prevent panic if index is out of bounds --- resources/resources.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/resources.go b/resources/resources.go index 17c77e4e..1e322a14 100644 --- a/resources/resources.go +++ b/resources/resources.go @@ -575,8 +575,11 @@ func (r *resources) Info() Info { Encoder: g.Encoder, Decoder: g.Decoder, UsageLimit: gpulimit, - Throttling: gputhrottling[i], }) + + if i < len(gputhrottling) { + gpuinfo.GPU[i].Throttling = gputhrottling[i] + } } i := Info{