diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 3d208d80eb2..8b0b482f33f 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -7897,7 +7897,7 @@ class Form
// Preparing gender's display if there is one
$addgendertxt = '';
- if ($object->gender) {
+ if (!empty($object->gender)) {
$addgendertxt = ' ';
switch ($object->gender) {
case 'man':