Skip to content

Commit

Permalink
returning nullptr instead of throwing exception
Browse files Browse the repository at this point in the history
  • Loading branch information
remibettan committed Oct 11, 2020
1 parent a568d3a commit f3a46ef
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/core/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,7 @@ namespace librealsense
std::shared_ptr<option> get_option_handler(rs2_option id) const
{
auto it = _options.find(id);
if (it == _options.end())
{
throw invalid_value_exception(to_string()
<< "Device does not support option "
<< get_option_name(id) << "!");
}
return it->second;
return (it == _options.end() ? std::shared_ptr<option>(nullptr) : it->second);
}

void register_option(rs2_option id, std::shared_ptr<option> option)
Expand Down

0 comments on commit f3a46ef

Please sign in to comment.