Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec9cfc2

Browse files
authored
Fixed: path none error
1 parent 9fcaa27 commit ec9cfc2

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

helper/utils.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,18 @@ def add_prefix_suffix(input_string, prefix='', suffix=''):
159159
return input_string
160160

161161
async def remove_path(ph_path, file_path, dl_path, metadata_path):
162-
if os.path.lexists(ph_path):
163-
os.remove(ph_path)
164-
if os.path.lexists(file_path):
165-
os.remove(file_path)
166-
if os.path.lexists(dl_path):
167-
os.remove(dl_path)
168-
if os.path.lexists(metadata_path):
169-
os.remove(metadata_path)
162+
if ph_path:
163+
if os.path.lexists(ph_path):
164+
os.remove(ph_path)
165+
if file_path:
166+
if os.path.lexists(file_path):
167+
os.remove(file_path)
168+
if dl_path:
169+
if os.path.lexists(dl_path):
170+
os.remove(dl_path)
171+
if metadata_path:
172+
if os.path.lexists(metadata_path):
173+
os.remove(metadata_path)
170174

171175
# (c) @RknDeveloperr
172176
# Rkn Developer

0 commit comments

Comments
 (0)