NicosKaralis/pushmeup

"with_connection" method raises an exception: NoMethodError: undefined method `close' for nil:NilClass

vrulevskii opened this issue · 0 comments

There is a code in file https://github.com/NicosKaralis/pushmeup/tree/master/lib/pushmeup/apns/core.rb
which returns the exception. It is

    rescue StandardError, Errno::EPIPE
      raise unless attempts < @retries

      @ssl.close # <== here we got an exception
      @sock.close

      attempts += 1
      retry
    end

Probably, you forget to check the condition unless @ssl.nil?
Could you, please, fix that?