From 6bbc9177f6ed60c7eeaf94e66921ebc0a3e91e76 Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Sat, 2 Nov 2024 11:32:03 +0700 Subject: [PATCH] fix: era subscription bug --- src/model/Subscribe/ActiveEra/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/model/Subscribe/ActiveEra/index.ts b/src/model/Subscribe/ActiveEra/index.ts index b12ff7e93..79f3f4848 100644 --- a/src/model/Subscribe/ActiveEra/index.ts +++ b/src/model/Subscribe/ActiveEra/index.ts @@ -49,6 +49,12 @@ export class ActiveEra implements Unsubscribable { // determine activeEra: toString used as alternative to `toHuman`, that puts commas in // numbers const activeEra = JSON.parse(result.unwrapOrDefault().toString()); + + // Return early if errornous active era is returned. + if (activeEra.index === 0 || !activeEra.start) { + return; + } + // Store active era. this.activeEra = { index: new BigNumber(activeEra.index),