From 2bdee34524487a47c057c16620dc1ebcfab5a66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0brahim=20Uysal?= Date: Mon, 18 Mar 2024 20:36:08 +0300 Subject: [PATCH] fix: if disc count lower than 3, it's crash --- marble-sculp/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/marble-sculp/api.py b/marble-sculp/api.py index acd416a..7b9b011 100644 --- a/marble-sculp/api.py +++ b/marble-sculp/api.py @@ -286,7 +286,11 @@ async def extend(request: Request, payload: DiscModel): # if i == 0 and j == 0: # continue # for d in range(len(payload.data)): - for d in range(3): + if len(payload.data) >= 3: + adet = 3 + else: + adet = len(payload.data) + for d in range(adet): discon = deepcopy(payload.data[d]) temp_circ = Circle(radius=10)