Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: fix resolve response validation
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Jun 27, 2019
1 parent f674826 commit 1405e1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/ipns/routing/experimental/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function dohBinary (url, domain, key) {
.arrayBuffer()

const data = dnsPacket.decode(Buffer.from(result))
if (!data && data.answers.length < 1) {
if (!data || data.answers.length < 1) {
throw errcode(new Error('Record not found'), 'ERR_NOT_FOUND')
}
const record = new Record(key, Buffer.from(Buffer.concat(data.answers[0].data).toString(), 'base64'))
Expand Down

0 comments on commit 1405e1f

Please sign in to comment.