don't crash on ``('JSONBareObject', (), (), ())``

master
Andreas Madsack 2020-12-11 16:45:33 +01:00
parent 6544daa5c6
commit 83530da6eb
No known key found for this signature in database
GPG Key ID: 3968ADA1F19D83B8
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,8 @@ class LodgeitUpload(MethodView):
for lexer in get_all_lexers():
# (name, aliases, filetypes, mimetypes)
# e.g. ('Diff', ('diff',), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch'))
if len(lexer[1]) == 0:
continue
name = lexer[1][0]
cts = lexer[3]
# find a content-type, preferably one with text/*