From 37f6cbc527796805c5f9707574ebfec3289806ec Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 17 Mar 2015 19:43:55 +0000
Subject: [PATCH] fix test on val.empty() in ExchangeOnelabParameter

---
 Common/GmshMessage.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp
index 3f6e145b1a..dcc5efbc79 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"))
-- 
GitLab