From b530c97b08ff3b72990f287ac3b382927d6ed0b5 Mon Sep 17 00:00:00 2001 From: Manohar Paluri Date: Fri, 28 Aug 2009 14:33:19 +0000 Subject: [PATCH] error checking for find operation on map --- cpp/ChordalBayesNet.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/ChordalBayesNet.h b/cpp/ChordalBayesNet.h index f4310d6b3..310a49b1c 100644 --- a/cpp/ChordalBayesNet.h +++ b/cpp/ChordalBayesNet.h @@ -56,11 +56,13 @@ public: inline ConditionalGaussian::shared_ptr get (const std::string& key) const { const_iterator cg = nodes.find(key); // get node + assert( cg != nodes.end() ); return cg->second; } inline ConditionalGaussian::shared_ptr operator[](const std::string& key) const { const_iterator cg = nodes.find(key); // get node + assert( cg != nodes.end() ); return cg->second; }