fw: ASF should check if FaceInfo exists before using it
refs: #3968
Change-Id: I4c20a51609dd714e6104b103a4bef63ac8761083
diff --git a/daemon/fw/asf-measurements.hpp b/daemon/fw/asf-measurements.hpp
index c6ff096..ba858df 100644
--- a/daemon/fw/asf-measurements.hpp
+++ b/daemon/fw/asf-measurements.hpp
@@ -215,10 +215,15 @@
void
extendFaceInfoLifetime(FaceInfo& info, const Face& face);
- FaceInfo&
+ FaceInfo*
get(nfd::face::FaceId faceId)
{
- return m_fit.at(faceId);
+ if (m_fit.find(faceId) != m_fit.end()) {
+ return &m_fit.at(faceId);
+ }
+ else {
+ return nullptr;
+ }
}
FaceInfoTable::iterator