浏览代码

Fix possible crash in TypesafeCachedYamlDatabase (#6873)

Vincent Stumpf 3 年之前
父节点
当前提交
ef6a682ca8
共有 1 个文件被更改,包括 1 次插入1 次删除
  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 )];