diff --git a/xroot_plugins/XrdProFile.cpp b/xroot_plugins/XrdProFile.cpp
index 08d1b5d3693a378b54c1963e40a15fafa7a8cb74..954a29114869df9943fa2c6cb3d5a8bd25031c19 100644
--- a/xroot_plugins/XrdProFile.cpp
+++ b/xroot_plugins/XrdProFile.cpp
@@ -321,7 +321,7 @@ std::string XrdProFile::getOptionValue(const std::vector<std::string> &tokens, c
   for(auto it=tokens.begin(); it!=tokens.end(); it++) {
     if(optionShortName == *it || optionLongName == *it) {
       auto it_next=it+1;
-      if(it_next!=tokens.end()) {
+      if(it_next!=tokens.end() && it_next->find("-")!=0) {
         return *it_next;
       }
       else {