ruby-ipfs-http-client icon indicating copy to clipboard operation
ruby-ipfs-http-client copied to clipboard

TypeError when adding a file from a multihash

Open tomibennett opened this issue 7 years ago • 0 comments

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

tomibennett avatar Jan 05 '18 10:01 tomibennett