Skip to content

Commit 0d4a890

Browse files
committed
Null check
1 parent 8845df2 commit 0d4a890

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

batch_file_rename.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def main():
6060
work_dir = args['work_dir'][0]
6161
# Set the variable old_ext with the second argument passed
6262
old_ext = args['old_ext'][0]
63-
if old_ext[0] != '.':
63+
if old_ext and old_ext[0] != '.':
6464
old_ext = '.' + old_ext
6565
# Set the variable new_ext with the third argument passed
6666
new_ext = args['new_ext'][0]
67-
if new_ext[0] != '.':
67+
if new_ext and new_ext[0] != '.':
6868
new_ext = '.' + new_ext
6969

7070
batch_rename(work_dir, old_ext, new_ext)

0 commit comments

Comments
 (0)