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

fix: typeof bug when passing timeout to dag.get #3035

Merged
merged 1 commit into from
May 14, 2020

Conversation

achingbrain
Copy link
Member

Passing options without a path to dag.get will throw an error.

ipfs.dag.get(cidPath, { timeout: 2000 })

TypeError: Cannot read property 'timeout' of null

Cause by the lovely JS issue of typeof null === 'object'.

Co-authored-by: Kia Rahimian kia@tintmail.com

Passing `options` without a `path` to dag.get will throw an error.
```
ipfs.dag.get(cidPath, { timeout: 2000 })

TypeError: Cannot read property 'timeout' of null
```

Cause by the lovely JS issue of `typeof null === 'object'`.

Co-authored-by: Kia Rahimian <kia@tintmail.com>
@achingbrain achingbrain requested a review from hugomrdias May 14, 2020 13:26
@achingbrain achingbrain merged commit 026a542 into master May 14, 2020
@achingbrain achingbrain deleted the fix/dag-get-with-options-and-no-path branch May 14, 2020 15:20
SgtPooki referenced this pull request in ipfs/js-kubo-rpc-client Aug 18, 2022
Passing `options` without a `path` to dag.get will throw an error.
```
ipfs.dag.get(cidPath, { timeout: 2000 })

TypeError: Cannot read property 'timeout' of null
```

Cause by the lovely JS issue of `typeof null === 'object'`.

Co-authored-by: Kia Rahimian <kia@tintmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants