Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when adding a file from a multihash #45

Open
tomibennett opened this issue Jan 5, 2018 · 0 comments
Open

TypeError when adding a file from a multihash #45

tomibennett opened this issue Jan 5, 2018 · 0 comments

Comments

@tomibennett
Copy link
Owner

When a new file is instanciated from a multihash, then added, a check is missing.

We need to ensure the path is present before requesting Ipfs.

The check must be added here.

> Ipfs::File.new(multihash: 'QmWnkQNY81dasvJmCG933V2V6W8PBdvDBvfEPL4mq1GHzY').add
TypeError: no implicit conversion of nil into String
      [...]
/http/client.rb:161:in `make_request_body'
        from /Users/tom/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/client.rb:30:in `request'
        from /Users/tom/dev/one_account/ruby-ipfs-api/lib/client.rb:30:in `call'
        from /Users/tom/dev/one_account/ruby-ipfs-api/lib/client.rb:41:in `execute'
        from /Users/tom/dev/one_account/ruby-ipfs-api/lib/file.rb:19:in `block in add'
        from /Users/tom/dev/one_account/ruby-ipfs-api/lib/file.rb:18:in `tap'
        from /Users/tom/dev/one_account/ruby-ipfs-api/lib/file.rb:18:in `add'
        from (irb):23
        from /Users/tom/.rbenv/versions/2.4.2/bin/irb:11:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant