mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix: yaml_dialog.py added return None if no file path is specified
This commit is contained in:
@ -32,6 +32,9 @@ def load_yaml(instance) -> dict:
|
||||
print(f"An error occurred while loading the settings from {file_path}: {e}")
|
||||
return None # Return None on exception to indicate failure
|
||||
|
||||
if not file_path:
|
||||
return None
|
||||
|
||||
|
||||
def save_yaml(instance, config: dict) -> None:
|
||||
"""
|
||||
@ -57,3 +60,6 @@ def save_yaml(instance, config: dict) -> None:
|
||||
print(f"Settings saved to {file_path}")
|
||||
except Exception as e:
|
||||
print(f"An error occurred while saving the settings to {file_path}: {e}")
|
||||
|
||||
if not file_path:
|
||||
return None
|
||||
|
Reference in New Issue
Block a user