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 #3023

Closed
wants to merge 1 commit into from

Conversation

mistakia
Copy link
Contributor

@mistakia mistakia commented May 6, 2020

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'.

@welcome
Copy link

welcome bot commented May 6, 2020

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

@achingbrain
Copy link
Member

Great spot, thanks! Could you please add a test to catch this sort of thing in future?

The tests for ipfs.dag.get are here: packages/interface-ipfs-core/src/dag/get.js

@achingbrain
Copy link
Member

Fixed in #3035 with a Co-authored-by so you get git history credit. Thanks for opening this PR!

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