fix: handle case where mimetype is None (#26131)
This commit is contained in:
parent
79d18c1fbb
commit
2ec9ef5bf3
1 changed files with 1 additions and 1 deletions
|
|
@ -276,7 +276,7 @@ def _get_base64_image(src):
|
|||
path = parsed_url.path
|
||||
query = parse_qs(parsed_url.query)
|
||||
mime_type = mimetypes.guess_type(path)[0]
|
||||
if not mime_type.startswith("image/"):
|
||||
if mime_type is None or not mime_type.startswith("image/"):
|
||||
return
|
||||
filename = query.get("fid") and query["fid"][0] or None
|
||||
file = find_file_by_url(path, name=filename)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue