From 61bcc04c3c3f686451c7e512b2618d83b1551b4f Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Sat, 25 Apr 2009 10:04:23 +0000
Subject: [PATCH] Return an empty string if the URL is None. This happens
 usually when an image is not uploaded yet.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26632 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ImageField.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/product/ERP5Form/ImageField.py b/product/ERP5Form/ImageField.py
index 375ff396ed..b0e792fbe3 100644
--- a/product/ERP5Form/ImageField.py
+++ b/product/ERP5Form/ImageField.py
@@ -75,6 +75,8 @@ class ImageFieldWidget(Widget.TextWidget):
         """Render image field as a link to the image
         """
         # Url is already defined in value
+        if value is None:
+          return ''
         image = value
         alt = field.get_value('description') or \
               field.get_value('title')
-- 
2.30.9