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

NPE calling Orm#value on a new resource. #25

Closed
jcoyne opened this issue Apr 18, 2014 · 0 comments
Closed

NPE calling Orm#value on a new resource. #25

jcoyne opened this issue Apr 18, 2014 · 0 comments

Comments

@jcoyne
Copy link
Member

jcoyne commented Apr 18, 2014

 res = Ldp::Resource::RdfSource.new(FedoraLens.connection, '/foobara')
=> #<Ldp::Resource::RdfSource:0x007fdc75020e28 @client=#<Ldp::Client:0x007fdc737ca838 @http=#<Faraday::Connection:0x007fdc737ca680 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v0.9.0"}, @params={}, @options=#<Faraday::RequestOptions (empty)>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @builder=#<Faraday::RackBuilder:0x007fdc737ca180 @handlers=[Faraday::Request::UrlEncoded, Faraday::Adapter::NetHttp]>, @url_prefix=#<URI::HTTP:0x007fdc75023e20 URL:http://localhost:8983/fedora/rest>, @proxy=nil>>, @subject="/foobara">
irb(main):003:0> orm = Ldp::Orm.new(res)
=> #<Ldp::Orm:0x007fdc750a0f10 @resource=#<Ldp::Resource::RdfSource:0x007fdc75020e28 @client=#<Ldp::Client:0x007fdc737ca838 @http=#<Faraday::Connection:0x007fdc737ca680 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v0.9.0"}, @params={}, @options=#<Faraday::RequestOptions (empty)>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @builder=#<Faraday::RackBuilder:0x007fdc737ca180 @handlers=[Faraday::Request::UrlEncoded, Faraday::Adapter::NetHttp]>, @url_prefix=#<URI::HTTP:0x007fdc75023e20 URL:http://localhost:8983/fedora/rest>, @proxy=nil>>, @subject="/foobara">>
irb(main):004:0> orm.value('foo')
NoMethodError: undefined method `query' for nil:NilClass
    from /Users/justin/workspace/ldp/lib/ldp/orm.rb:22:in `value'
    from (irb):4
@jcoyne jcoyne closed this as completed Apr 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant