fix(services): check for possible None progress when moving folders

This commit is contained in:
Houkime 2024-02-19 00:10:13 +00:00
parent fb41c092f1
commit f059c83b57
2 changed files with 4 additions and 1 deletions

View file

@ -60,6 +60,9 @@ def move_folders_to_volume(
job: Job, job: Job,
) -> None: ) -> None:
current_progress = job.progress current_progress = job.progress
if current_progress is None:
current_progress = 0
folder_percentage = 50 // len(folders) folder_percentage = 50 // len(folders)
for folder in folders: for folder in folders:
folder_name = get_foldername(folder) folder_name = get_foldername(folder)

View file

@ -311,8 +311,8 @@ class Service(ABC):
Only changes userdata Only changes userdata
""" """
service_id = cls.get_id()
with WriteUserData() as user_data: with WriteUserData() as user_data:
service_id = cls.get_id()
if "modules" not in user_data: if "modules" not in user_data:
user_data["modules"] = {} user_data["modules"] = {}
if service_id not in user_data["modules"]: if service_id not in user_data["modules"]: