Skip to content
Snippets Groups Projects
Commit 1656f508 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

Merge branch 'block-exception-fix' into 'master'

Replaces exception thrown on getBlock with NULL

See merge request !12
parents 58a35558 9f82af91
Branches
Tags
No related merge requests found
...@@ -276,7 +276,13 @@ public: ...@@ -276,7 +276,13 @@ public:
*/ */
//******************************************************************************************************************* //*******************************************************************************************************************
virtual const IBlock* getBlock( const IBlockID& id ) const = 0; 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: ...@@ -291,7 +297,13 @@ public:
*/ */
//******************************************************************************************************************* //*******************************************************************************************************************
virtual IBlock* getBlock( const IBlockID& id ) = 0; 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;
}
//******************************************************************************************************************* //*******************************************************************************************************************
/*! /*!
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment