Skip to content

Commit

Permalink
[FIX] ignore files with unknown mimetype
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn committed Jun 20, 2017
1 parent e5b00ee commit 60fb31e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion document_ocr/models/ir_attachment.py
Expand Up @@ -18,7 +18,7 @@ class IrAttachment(models.Model):
def _index(self, data, datas_fname, file_type):
mimetype, content = super(IrAttachment, self)._index(
data, datas_fname, file_type)
if not content or content == 'image':
if mimetype and (not content or content == 'image'):
has_synchr_param = self.env['ir.config_parameter'].get_param(
'document_ocr.synchronous', 'False') == 'True'
has_force_flag = self.env.context.get('document_ocr_force')
Expand Down

0 comments on commit 60fb31e

Please sign in to comment.