Skip to content

Commit

Permalink
Fix case with abscent play
Browse files Browse the repository at this point in the history
  • Loading branch information
FinemechanicPub committed Oct 10, 2024
1 parent 5da59cf commit 41f1381
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/library/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def _hidden_path(play) -> Path:

def restore_play_file(play):
"""Вернуть файл из скрытого хранилища в общее."""
if not play.url_download:
if not play or not play.url_download:
return
regular_play_file = Path(play.url_download.path)
hidden_play_file = _hidden_path(play)
Expand All @@ -20,7 +20,7 @@ def restore_play_file(play):

def hide_play_file(play):
"""Переместить файл из общего хранилища в скрытое."""
if not play.url_download:
if not play or not play.url_download:
return
regular_play_file = Path(play.url_download.path)
hidden_play_file = _hidden_path(play)
Expand Down

0 comments on commit 41f1381

Please sign in to comment.