srt_fix
srt_fix copied to clipboard
Fix TypeError
Problem
The following line gives an error:
elif os.path.isdir(output_file):
The error:
TypeError: _path_isdir: path should be string, bytes, os.PathLike or integer, not NoneType
Solution
Add a guard to ensure output_file is not None before calling os.path.isdir():
elif output_file and os.path.isdir(output_file):
Note
Apologies if I did something wrong. I'm trying to learn how GitHub works, and how to contribute.