diff --git a/frappe/core/doctype/file/file.py b/frappe/core/doctype/file/file.py index b4bfe1d21b..62da523110 100755 --- a/frappe/core/doctype/file/file.py +++ b/frappe/core/doctype/file/file.py @@ -703,7 +703,10 @@ def get_web_image(file_url): frappe.msgprint(_("Unable to read file format for {0}").format(file_url)) raise - image = Image.open(StringIO(frappe.safe_decode(r.content))) + try: + image = Image.open(StringIO(frappe.safe_decode(r.content))) + except: + frappe.throw(_("Image link {0} is not valid").format(file_url), IOError) try: filename, extn = file_url.rsplit("/", 1)[1].rsplit(".", 1)