Handle empty pools table error

This commit is contained in:
nymkappa 2022-04-07 18:14:28 +09:00
parent e451b40084
commit ba12b10f9d
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -135,6 +135,12 @@ class Blocks {
} else {
pool = await poolsRepository.$getUnknownPool();
}
if (!pool) { // Something is wrong with the pools table, ignore pool indexing
logger.err('Unable to find pool, nor getting the unknown pool. Is the "pools" table empty?');
return blockExtended;
}
blockExtended.extras.pool = {
id: pool.id,
name: pool.name,