Skip to content

Commit

Permalink
fix: return None if loading failed to avoid using var data before ass…
Browse files Browse the repository at this point in the history
…ignment;
  • Loading branch information
WenjieDu committed Jul 4, 2024
1 parent 8993137 commit 4200c94
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pypots/data/saving/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ def pickle_load(path: str) -> object:
data = pickle.load(f)
except Exception as e:
logger.error(f"❌ Loading data failed. Operation aborted. See info below:\n{e}")
return None
return data

0 comments on commit 4200c94

Please sign in to comment.