diff --git a/alib2str/src/abstraction/StringReaderRegistry.cpp b/alib2str/src/abstraction/StringReaderRegistry.cpp index e7eadf1298d92ca0f5fe2b75905699733b9ec088..e7ba537e8df01a55676d915394a6b6537a3323f3 100644 --- a/alib2str/src/abstraction/StringReaderRegistry.cpp +++ b/alib2str/src/abstraction/StringReaderRegistry.cpp @@ -16,8 +16,9 @@ std::shared_ptr < abstraction::OperationAbstraction > StringReaderRegistry::getA return entry.first ( ss ); }; - typename ext::deque < std::pair < std::function < bool ( std::istream & ) >, std::unique_ptr < Entry > > >::iterator callback = find_if ( getEntries ( ) [ group ].begin ( ), getEntries ( ) [ group ].end ( ), lambda ); - if ( callback == getEntries ( ) [ group ].end ( ) ) + const auto & entries = getEntries ( ) [ group ]; + typename ext::deque < std::pair < std::function < bool ( std::istream & ) >, std::unique_ptr < Entry > > >::const_iterator callback = find_if ( entries.begin ( ), entries.end ( ), lambda ); + if ( callback == entries.end ( ) ) throw exception::CommonException ( "Entry not available." ); return callback->second->getAbstraction ( );