Skip to content

Commit

Permalink
fix: handle case where mimetype is None (#26131)
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Apr 23, 2024
1 parent 79d18c1 commit 2ec9ef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/utils/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2ec9ef5

Please sign in to comment.