diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 14982928341..2fc74e99f60 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3494,13 +3494,13 @@ function setEventMessage($mesgs, $style='mesgs') if (! in_array($style,array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter for setEventMessage'); if (! is_array($mesgs)) // If mesgs is a string { - $_SESSION['dol_events'][$style][] = $mesgs; + if ($mesgs) $_SESSION['dol_events'][$style][] = $mesgs; } else // If mesgs is an array { foreach($mesgs as $mesg) { - $_SESSION['dol_events'][$style][] = $mesg; + if ($mesg) $_SESSION['dol_events'][$style][] = $mesg; } } }