Browse Source

Fix possible crash in TypesafeCachedYamlDatabase (#6873)

Vincent Stumpf 3 years ago
parent
commit
ef6a682ca8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/common/database.hpp

+ 1 - 1
src/common/database.hpp

@@ -159,7 +159,7 @@ public:
 	}
 
 	std::shared_ptr<datatype> find( keytype key ) override{
-		if( this->cache.empty() || key >= this->cache.capacity() ){
+		if( this->cache.empty() || key >= this->cache.size() ){
 			return TypesafeYamlDatabase<keytype, datatype>::find( key );
 		}else{
 			return cache[this->calculateCacheKey( key )];