message: Guard against empty paths and parts
diff: @@ -2293,9 +2293,15 @@ Group* Group::walkPath(std::string& path, bool create_groups_in_path)
  {
  Group* group_ptr = this;
  - const std::vector<std::string> path_parts =
  + // Split path into parts and remove empty parts
  + std::vector<std::string> path_parts =
  axom::Path(path, s_path_delimiter).parts();
  + path_parts.erase(std::remove_if(path_parts.begin(), path_parts.end(),
  + [](std::string const& s) { return s.size() == 0;}),
  + path_parts.end());
  + if (path_parts.size() > 0)
  + {
  // Find stopping point (right before last part of path)
  std::vector<std::string>::const_iterator stop = path_parts.end() - 1;
  @@ -2304,12 +2310,6 @@ Group* Group::walkPath(std::string& path, bool create_groups_in_path)
  iter < stop;
  ++iter)
  {
  - if(*iter == "")
  - {
  - // skip empty names
  - continue;
  - }
  -
  if(group_ptr->hasChildGroup(*iter))
  {
  group_ptr = group_ptr->getGroup(*iter);
  @@ -2330,6 +2330,7 @@ Group* Group::walkPath(std::string& path, bool create_groups_in_path)
  }
  }
  path = path_parts.back();
  + }
  return group_ptr;
  }
  @@ -2347,9 +2348,15 @@ const Group* Group::walkPath(std::string& path) const
  {
  const Group* group_ptr = this;
  - const std::vector<std::string> path_parts =
  + // Split path into parts and remove empty parts
  + std::vector<std::string> path_parts =
  axom::Path(path, s_path_delimiter).parts();
  + path_parts.erase(std::remove_if(path_parts.begin(), path_parts.end(),
  + [](std::string const& s) { return s.size() == 0;}),
  + path_parts.end());
  + if (path_parts.size() > 0)
  + {
  // Find stopping point (right before last part of path)
  std::vector<std::string>::const_iterator stop = path_parts.end() - 1;
  @@ -2358,12 +2365,6 @@ const Group* Group::walkPath(std::string& path) const
  iter < stop;
  ++iter)
  {
  - if(*iter == "")
  - {
  - // skip empty names
  - continue;
  - }
  -
  if(group_ptr->hasChildGroup(*iter))
  {
  group_ptr = group_ptr->getGroup(*iter);
  @@ -2375,6 +2376,7 @@ const Group* Group::walkPath(std::string& path) const
  }
  }
  path = path_parts.back();
  + }
  return group_ptr;
  }
  