return empty skins if path doesnt exist

This commit is contained in:
SemvdH
2025-11-17 23:10:03 +01:00
parent ac6bcbb58a
commit eec2888f7b

View File

@@ -32,6 +32,9 @@ def get_all_cars():
def get_car_skins(car: str) -> list[str]:
car_path = os.path.join(CARS_FOLDER, car);
skin_path = os.path.join(car_path, "skins")
if os.path.exists(skin_path) == False:
return []
skindirs = [x.path.replace(skin_path + "/","") for x in os.scandir(skin_path) if x.is_dir()]
return skindirs