samvera / ldp

Linked Data Platform.rb client
Other
16 stars 15 forks source link

If Resource is initialized without a connection it gets NPE #23

Closed jcoyne closed 3 years ago

jcoyne commented 10 years ago
/Users/justin/workspace/ldp/lib/ldp/resource.rb:28:in `new?': undefined method `head' for nil:NilClass (NoMethodError)
    from /Users/justin/workspace/ldp/lib/ldp/resource/rdf_source.rb:39:in `graph'
    from /Users/justin/workspace/ldp/lib/ldp/orm.rb:17:in `block in graph'
    from /Users/justin/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/notifications.rb:161:in `instrument'
    from /Users/justin/workspace/ldp/lib/ldp.rb:32:in `instrument'
    from /Users/justin/workspace/ldp/lib/ldp/orm.rb:16:in `graph'

Probably should check that connection is present on initialize

cbeer commented 10 years ago

Why isn't there a connection present?

jcoyne commented 10 years ago

cbeer: It is a wrong usage, but we probably should check that the users provides a connection, right?

cbeer commented 10 years ago

I think failing fast sounds good, right?