From 9f82af919e85b15d1861c6dba5c3124c1066c5ac Mon Sep 17 00:00:00 2001 From: Felix Winterhalter <Felix@audiofair.de> Date: Fri, 28 Apr 2017 14:25:21 +0200 Subject: [PATCH] Change from .at to .find and NULL --- src/domain_decomposition/BlockStorage.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/domain_decomposition/BlockStorage.h b/src/domain_decomposition/BlockStorage.h index 5b2dbfedf..4d3292e21 100644 --- a/src/domain_decomposition/BlockStorage.h +++ b/src/domain_decomposition/BlockStorage.h @@ -276,7 +276,13 @@ public: */ //******************************************************************************************************************* virtual const IBlock* getBlock( const IBlockID& id ) const = 0; - inline const IBlock* getBlock( const IBlockID::IDType& id) const { return iBlocks_.at(id); } + inline const IBlock* getBlock( const IBlockID::IDType& id) const { + auto it = iBlocks_.find(id); + + if( it != iBlocks_.end()) return it->second; + + return NULL; + } //******************************************************************************************************************* /*! @@ -291,7 +297,13 @@ public: */ //******************************************************************************************************************* virtual IBlock* getBlock( const IBlockID& id ) = 0; - inline IBlock* getBlock( const IBlockID::IDType& id) { return iBlocks_.at(id); } + inline IBlock* getBlock( const IBlockID::IDType& id) { + auto it = iBlocks_.find(id); + + if( it != iBlocks_.end()) return it->second; + + return NULL; + } //******************************************************************************************************************* /*! -- GitLab