Skip to content

Commit

Permalink
fix None issue on db shutdown during failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Dec 9, 2023
1 parent 5596266 commit 1e04b46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prime_backup/db/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def init(cls, auto_migrate: bool = True):

@classmethod
def shutdown(cls):
logger = db_logger.get()
for hdr in list(logger.handlers):
logger.removeHandler(hdr)
if (logger := db_logger.get()) is not None:
for hdr in list(logger.handlers):
logger.removeHandler(hdr)

@classmethod
def get_db_path(cls) -> Path:
Expand Down

0 comments on commit 1e04b46

Please sign in to comment.