diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index e25f4d0c71594dbc6509f912a651a8c0c80ce3de..8b636fd247f8e0cfe24eedfb3ef02c9c7a05f3b2 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -748,6 +748,8 @@ abstract class DolibarrModules
 
         $err=0;
 
+        if (empty($this->const)) return 0;
+
         foreach ($this->const as $key => $value)
         {
             $name      = $this->const[$key][0];
@@ -816,6 +818,8 @@ abstract class DolibarrModules
 
         $err=0;
 
+        if (empty($this->const)) return 0;
+
         foreach ($this->const as $key => $value)
         {
             $name      = $this->const[$key][0];