Skip to content

Commit

Permalink
prtect against missing color sensor d400
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Sep 23, 2024
1 parent 4feb8b1 commit 5da690a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ds/d400/d400-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,13 @@ namespace librealsense
using namespace ds;

std::vector<std::shared_ptr<platform::uvc_device>> depth_devices;
for (auto&& info : filter_by_mi(all_device_infos, 0)) // Filter just mi=0, DEPTH
auto depth_devs_info = filter_by_mi( all_device_infos, 0 );

if ( depth_devs_info.empty() )
{
throw backend_exception("cannot access depth sensor", RS2_EXCEPTION_TYPE_BACKEND);
}
for (auto&& info : depth_devs_info) // Filter just mi=0, DEPTH
depth_devices.push_back( get_backend()->create_uvc_device( info ) );

std::unique_ptr< frame_timestamp_reader > timestamp_reader_backup( new ds_timestamp_reader() );
Expand Down

0 comments on commit 5da690a

Please sign in to comment.