fix various coverity issues
This commit is contained in:
@@ -95,19 +95,25 @@ bool ExtensionContainer::hasExtension(const std::string& name) const {
|
||||
|
||||
|
||||
Extension* ExtensionContainer::getExtension(Base::Type t, bool derived) const {
|
||||
|
||||
|
||||
auto result = _extensions.find(t);
|
||||
if((result == _extensions.end()) && derived) {
|
||||
//we need to check for derived types
|
||||
for(auto entry : _extensions) {
|
||||
for(auto entry : _extensions) {
|
||||
if(entry.first.isDerivedFrom(t))
|
||||
return entry.second;
|
||||
}
|
||||
//if we arive hear we don't have anything matching
|
||||
|
||||
//if we arrive here we don't have anything matching
|
||||
throw Base::TypeError("ExtensionContainer::getExtension: No extension of given type available");
|
||||
}
|
||||
else if (result != _extensions.end()) {
|
||||
return result->second;
|
||||
}
|
||||
else {
|
||||
//if we arrive here we don't have anything matching
|
||||
throw Base::TypeError("ExtensionContainer::getExtension: No extension of given type available");
|
||||
}
|
||||
|
||||
return result->second;
|
||||
}
|
||||
|
||||
bool ExtensionContainer::hasExtensions() const {
|
||||
|
||||
Reference in New Issue
Block a user