diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php
index d5f47502a9..433a60c47f 100644
--- a/core/attributedef.class.inc.php
+++ b/core/attributedef.class.inc.php
@@ -5538,8 +5538,8 @@ class AttributeImage extends AttributeBlob
{
$iMaxWidthPx = $this->Get('display_max_width');
$iMaxHeightPx = $this->Get('display_max_height');
- $sUrl = $this->GetOptional('default_image', '');
- $sRet = '';
+ $sUrl = $this->Get('default_image');
+ $sRet = ($sUrl !== null) ? '
' : '';
if (is_object($value) && !$value->IsEmpty())
{
if ($oHostObject->IsNew() || ($oHostObject->IsModified() && (array_key_exists($this->GetCode(), $oHostObject->ListChanges()))))
diff --git a/core/pdfbulkexport.class.inc.php b/core/pdfbulkexport.class.inc.php
index 0006e01991..d27cd67e5f 100644
--- a/core/pdfbulkexport.class.inc.php
+++ b/core/pdfbulkexport.class.inc.php
@@ -226,9 +226,9 @@ EOF
$iNewWidth = $iWidth * $fScale;
$iNewHeight = $iHeight * $fScale;
- $sUrl = 'data:' . $value->GetMimeType() . ';base64,' . base64_encode($value->GetData());
+ $sUrl = 'data:'.$value->GetMimeType().';base64,'.base64_encode($value->GetData());
}
- $sRet = '
';
+ $sRet = ($sUrl !== null) ? '
' : '';
$sRet = '