Skip to content

Commit

Permalink
fix: Don't cause exception when download name is not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Aug 9, 2019
1 parent cdbe233 commit 604a0ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/aria2p/downloads.py
Expand Up @@ -225,7 +225,10 @@ def name(self):
if file_path.startswith(dir_path):
self._name = Path(file_path[len(dir_path) + 1 :]).parts[0]
else:
self._name = self.files[0].uris[0]["uri"].split("/")[-1]
try:
self._name = self.files[0].uris[0]["uri"].split("/")[-1]
except IndexError:
pass
return self._name

@property
Expand Down

0 comments on commit 604a0ab

Please sign in to comment.