Skip to content

Commit

Permalink
Merge pull request #133 from ensdomains/invalid-name-fix
Browse files Browse the repository at this point in the history
Patch invalid names for now
  • Loading branch information
LeonmanRolls authored Apr 18, 2023
2 parents b80c796 + c1ee902 commit 0e2cb01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/ensjs/src/GqlManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ export const responseMiddleware =
return
}

const hashedName = namehash(responseItem.name)
let hashedName = '[Invalid ENS Name]'
try {
hashedName = namehash(responseItem.name)
} catch (e) {
this.update({ ...responseItem, name: hashedName, invalidName: true })
return
}
if (responseItem.id !== hashedName) {
this.update({ ...responseItem, name: hashedName, invalidName: true })
}
Expand Down

0 comments on commit 0e2cb01

Please sign in to comment.