diff --git a/governance/pyth_staking_sdk/src/pyth-staking-client.ts b/governance/pyth_staking_sdk/src/pyth-staking-client.ts index a13b2c38b..cd4317918 100644 --- a/governance/pyth_staking_sdk/src/pyth-staking-client.ts +++ b/governance/pyth_staking_sdk/src/pyth-staking-client.ts @@ -784,10 +784,11 @@ export class PythStakingClient { let lowestEpoch: bigint | undefined; for (const record of delegationRecords) { - if (record !== null) { - if (lowestEpoch === undefined || record.lastEpoch < lowestEpoch) { - lowestEpoch = record.lastEpoch; - } + if ( + record !== null && + (lowestEpoch === undefined || record.lastEpoch < lowestEpoch) + ) { + lowestEpoch = record.lastEpoch; } }