diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index 74223873f45..7c31ca163bf 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -1902,7 +1902,7 @@ function dol_print_error($db='',$error='')
$out.="".$langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."
\n";;
$out.="
\n";
$out.="".$langs->trans("RequestedUrl").": ".$_SERVER["REQUEST_URI"]."
\n";;
- $out.="".$langs->trans("Referer").": ".$_SERVER["HTTP_REFERER"]."
\n";;
+ $out.="".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'')."
\n";;
$out.="".$langs->trans("MenuManager").": ".$conf->top_menu.($conf->top_menu||$conf->left_menu?'/':'').$conf->left_menu."
\n";
$out.="
\n";
$syslog.="url=".$_SERVER["REQUEST_URI"];