mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Handle GetLatestResult segfault (#259)
* Handle GetLatestResult segfault * Update PhotonCamera.cpp * Update PhotonCamera.cpp
This commit is contained in:
@@ -45,7 +45,10 @@ PhotonPipelineResult PhotonCamera::GetLatestResult() const {
|
||||
PhotonPipelineResult result;
|
||||
|
||||
// Fill the packet with latest data and populate result.
|
||||
std::string value = rawBytesEntry.GetValue()->GetRaw();
|
||||
std::shared_ptr<nt::Value> ntvalue = rawBytesEntry.GetValue();
|
||||
if (!ntvalue) return result;
|
||||
|
||||
std::string value = ntvalue->GetRaw();
|
||||
std::vector<char> bytes{value.begin(), value.end()};
|
||||
|
||||
photonlib::Packet packet{bytes};
|
||||
|
||||
Reference in New Issue
Block a user