Added check
authorThierry Florac <thierry.florac@onf.fr>
Fri, 06 Jul 2018 18:05:59 +0200
changeset 805 c477732d8d62
parent 804 16feb37fe22a
child 806 9a308106275c
Added check
src/pyams_content/shared/common/skin/opengraph.py
--- a/src/pyams_content/shared/common/skin/opengraph.py	Thu Jul 05 15:12:11 2018 +0200
+++ b/src/pyams_content/shared/common/skin/opengraph.py	Fri Jul 06 18:05:59 2018 +0200
@@ -78,7 +78,7 @@
             if (illustration is not None) and illustration.has_data():
                 break
             target = get_parent(target, IIllustrationTarget, allow_context=False)
-        if illustration is not None:
+        if (target is not None) and (illustration is not None):
             data = II18n(illustration).query_attribute('data', lang=lang, request=request)
             thumbnail = IThumbnails(data).get_thumbnail('800x600')
             yield PropertyMeta('og:image:url', absolute_url(thumbnail, self.request))