Skip to content

Commit

Permalink
Fixed bug in rcg::getEnum() function that may lead to a seg fault
Browse files Browse the repository at this point in the history
  • Loading branch information
heikohimu committed Jan 1, 2019
1 parent d77877b commit f6c18d4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rc_genicam_api/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,16 @@ std::string getEnum(const std::shared_ptr<GenApi::CNodeMapRef> &nodemap, const c

if (val != 0)
{
ret=val->GetCurrentEntry()->GetSymbolic();
GenApi::IEnumEntry *entry=val->GetCurrentEntry();

if (entry != 0)
{
ret=entry->GetSymbolic();
}
else if (exception)
{
throw std::invalid_argument(std::string("Current value is not defined: ")+name);
}
}
else if (exception)
{
Expand Down

0 comments on commit f6c18d4

Please sign in to comment.