diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php
index 1c302c33b2e..33b3b8bdccd 100644
--- a/htdocs/public/ticket/create_ticket.php
+++ b/htdocs/public/ticket/create_ticket.php
@@ -425,7 +425,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) {
$messagetoshow = str_replace(array('{s1}', '{s2}'), array(''.$object->track_id.'', ''.$object->ref.''), $messagetoshow);
setEventMessages($messagetoshow, null, 'warnings');
setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings');
- header("Location: index.php".(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:''));
+ header("Location: index.php".(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:''));
exit;
}
} else {