diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp
index 3f6e145b1a95b3133a34153f139a295baad28bcf..dcc5efbc79dfb9b3f3d84bc6e905a2ec78c88b07 100644
--- a/Common/GmshMessage.cpp
+++ b/Common/GmshMessage.cpp
@@ -984,7 +984,12 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
                                   std::map<std::string, std::vector<std::string> > &copt)
 {
 #if defined(HAVE_ONELAB)
-  if(!_onelabClient || val.empty()) return;
+  if(!_onelabClient) return;
+
+  if(val.empty()){
+    Msg::Error("No value to exchange with ONELAB");
+    return;
+  }
 
   std::string name;
   if(copt.count("Name"))
@@ -1097,7 +1102,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
                                   std::map<std::string, std::vector<std::string> > &copt)
 {
 #if defined(HAVE_ONELAB)
-  if(!_onelabClient || val.empty()) return;
+  if(!_onelabClient) return;
 
   std::string name;
   if(copt.count("Name"))