chuckremes / ffi-rzmq

FFI bindings for ZeroMQ so the library can be used under JRuby and other FFI-compliant ruby runtimes
242 stars 62 forks source link

Uncaught exception: undefined method >=' for nil:NilClass ~/.rvm/gems… #129

Closed valeraradu closed 6 years ago

valeraradu commented 6 years ago

…/ruby-2.3.1/gems/ffi-rzmq-2.0.5/lib/ffi-rzmq/util.rb:33:inresultcode_ok?'

~/.rvm/gems/ruby-2.3.1/gems/zss-0.3.4/lib/zss/socket.rb:95:in check!' ~/.rvm/gems/ruby-2.3.1/gems/zss-0.3.4/lib/zss/socket.rb:55:incontext' ~/.rvm/gems/ruby-2.3.1/gems/zss-0.3.4/lib/zss/socket.rb:26:in call' ~/.rvm/gems/ruby-2.3.1/gems/zss-0.3.4/lib/zss/client.rb:36:incall' ~/.rvm/gems/ruby-2.3.1/gems/zss-0.3.4/lib/zss/client.rb:55:in method_missing' ~/ruby_microservice_test/zmq-service-suite-ruby-bootstrap/bin/zss-client:15:in<top (required)>'

chuckremes commented 6 years ago

@valeraradu Sorry, but that change won't work. If the unless clause fails, then the method will return nil. The else needs to be there.

Alternately, change this into a guard clause where you return 0 if ctx.nil? || ctx.null? or similar and then have the call to LibZMQ.zmq_ctm_term after the clause. That's acceptable too.

chuckremes commented 6 years ago

Thanks for your contribution, @valeraradu. I'll release a 2.0.6 within a week.