Commit 67e233f2 authored by Ivan Tyagov's avatar Ivan Tyagov

Handle case of missing filter name.

Tests passing at
https://nexedi.erp5.net/test_result_module/20200102-6DAB14B9

/reviewed-on !23
parent 3f8c1a48
......@@ -250,8 +250,10 @@ class MimeMapper(object):
return filter.getName()
filter_list.sort(key=lambda x: x.getSortIndex())
return filter_list[-1].getName()
else:
elif len(filter_list) == 1:
return filter_list[0].getName()
# no filter found but rest of code expects string despite empty ...
return ''
def getFilterList(self, extension):
"""Search filter by extension, and return the filter as string.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment