Skip to content

Commit

Permalink
Address reviewer feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Sep 9, 2020
1 parent 999537b commit ca51a90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ServerConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ void copyElement(sdf::ElementPtr _sdf, const tinyxml2::XMLElement *_xml)


/////////////////////////////////////////////////
std::list<ServerConfig::PluginInfo> Parse(tinyxml2::XMLDocument &_doc)
std::list<ServerConfig::PluginInfo> Parse(const tinyxml2::XMLDocument &_doc)
{
auto ret = std::list<ServerConfig::PluginInfo>();
auto _elem = _doc.RootElement();
Expand Down
10 changes: 9 additions & 1 deletion src/SimulationRunner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,15 @@ void SimulationRunner::LoadServerPlugins(const ServerConfig &_config)
<< plugin.EntityType() << "]" << std::endl;
}

this->LoadPlugin(entity, plugin.Filename(), plugin.Name(), plugin.Sdf());
if (kNullEntity != entity)
{
this->LoadPlugin(entity, plugin.Filename(), plugin.Name(), plugin.Sdf());
}
else
{
ignwarn << "Attempting to attach plugin [" << plugin.Name() <<
" to an unknown entity. Plugin won't be loaded" << std::endl;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/SimulationRunner.hh
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ namespace ignition
const sdf::ElementPtr &_sdf);

/// \brief Load server plugins for a given entity.
/// \param[in] _config Configuration to load plugins from.
public: void LoadServerPlugins(const ServerConfig &_config);

/// \brief Get whether this is running. When running is true,
Expand Down

0 comments on commit ca51a90

Please sign in to comment.