Skip to content

Commit 8b31fd6

Browse files
committed
fix: 分段不支持类型的文件报错
1 parent c0d0f53 commit 8b31fd6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/common/handle/impl/text_split_handle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def support(self, file, get_buffer):
2929
if file_name.endswith(".md") or file_name.endswith('.txt'):
3030
return True
3131
result = detect(buffer)
32-
if result['encoding'] != 'ascii' and result['confidence'] > 0.5:
32+
if result['encoding'] is not None and result['confidence'] is not None and result['encoding'] != 'ascii' and \
33+
result['confidence'] > 0.5:
3334
return True
3435
return False
3536

0 commit comments

Comments
 (0)