Skip to content

Commit b35a2fe

Browse files
[Bugfix:Plagiarism] Properly handle unknown file types (#93)
1 parent 25a1356 commit b35a2fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/concatenate_all.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def getConcatFilesInDir(input_dir, regex_patterns):
5353

5454
# check for MIME types which are not supported
5555
file_type = mimetypes.guess_type(my_file)[0]
56-
if file_type.endswith("/pdf") or file_type.startswith("image/"):
56+
if file_type is not None and \
57+
(file_type.endswith("/pdf") or file_type.startswith("image/")):
5758
continue
5859

5960
absolute_path = os.path.join(my_dir, my_file)

0 commit comments

Comments
 (0)