Skip to content

Commit

Permalink
fix, #947
Browse files Browse the repository at this point in the history
  • Loading branch information
hyifeng committed Aug 27, 2024
1 parent df4b335 commit 37eb991
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ const { extractEvent } = require("./extractEventInfo");

async function event(_, _args) {
const { blockHeight, eventIndex } = _args;
const extrinsicData = await chainCall((api) =>
const eventData = await chainCall((api) =>
getEventData(api, blockHeight, eventIndex),
);
return extractEvent(extrinsicData);
if (!eventData) {
return;
}
return extractEvent(eventData);
}

module.exports = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function extractExtrinsicEventInfos(allBlockEvents, extrinsicIndexer) {
}

async function extractExtrinsicInfo(api, extrinsicData) {
if (!extrinsicData) {
return null;
}
const { extrinsic, allBlockEvents, indexer } = extrinsicData;
const events = extractExtrinsicEvents(allBlockEvents, indexer.extrinsicIndex);
const calls = await extractCallsFromExtrinsic(
Expand Down

0 comments on commit 37eb991

Please sign in to comment.