return empty skins if path doesnt exist
This commit is contained in:
@@ -32,6 +32,9 @@ def get_all_cars():
|
|||||||
def get_car_skins(car: str) -> list[str]:
|
def get_car_skins(car: str) -> list[str]:
|
||||||
car_path = os.path.join(CARS_FOLDER, car);
|
car_path = os.path.join(CARS_FOLDER, car);
|
||||||
skin_path = os.path.join(car_path, "skins")
|
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()]
|
skindirs = [x.path.replace(skin_path + "/","") for x in os.scandir(skin_path) if x.is_dir()]
|
||||||
return skindirs
|
return skindirs
|
||||||
|
|
||||||
Reference in New Issue
Block a user