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

An occasional include? on nil error #54

Closed
asafigan opened this issue Dec 14, 2017 · 2 comments
Closed

An occasional include? on nil error #54

asafigan opened this issue Dec 14, 2017 · 2 comments

Comments

@asafigan
Copy link

I am getting this error occasional.

my code:

results = base.contacts.where(is_organization: true, email: email)

The error:

vendor/bundle/ruby/2.1.0/gems/basecrm-1.2.3/lib/basecrm/middlewares/raise_error.rb:11 in on_complete
vendor/bundle/ruby/2.1.0/gems/faraday-0.9.1/lib/faraday/response.rb:9 in block in call
vendor/bundle/ruby/2.1.0/gems/faraday-0.9.1/lib/faraday/response.rb:57 in on_complete
vendor/bundle/ruby/2.1.0/gems/faraday-0.9.1/lib/faraday/response.rb:8 in call
vendor/bundle/ruby/2.1.0/gems/basecrm-1.2.3/lib/basecrm/middlewares/oauth_bearer_token.rb:13 in call
vendor/bundle/ruby/2.1.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139 in build_response
vendor/bundle/ruby/2.1.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377 in run_request
vendor/bundle/ruby/2.1.0/gems/faraday-0.9.1/lib/faraday/connection.rb:140 in get
vendor/bundle/ruby/2.1.0/gems/basecrm-1.2.3/lib/basecrm/http_client.rb:67 in request
vendor/bundle/ruby/2.1.0/gems/basecrm-1.2.3/lib/basecrm/http_client.rb:66 in instance_eval
vendor/bundle/ruby/2.1.0/gems/basecrm-1.2.3/lib/basecrm/http_client.rb:66 in request
vendor/bundle/ruby/2.1.0/gems/basecrm-1.2.3/lib/basecrm/http_client.rb:34 in get
vendor/bundle/ruby/2.1.0/gems/basecrm-1.2.3/lib/basecrm/services/contacts_service.rb:43 in where
@Swizec
Copy link

Swizec commented Jan 8, 2018

I am getting a similar error on deals.

my code:

deal = client.deals.where(contact_id: payer_info.crm_id).last

The error:

NoMethodError: undefined method `include?' for nil:NilClass
	from /app/vendor/bundle/ruby/2.2.0/gems/basecrm-1.2.3/lib/basecrm/middlewares/raise_error.rb:11:in `on_complete'
	from /app/vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/faraday/response.rb:9:in `block in call'
	from /app/vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/faraday/response.rb:57:in `on_complete'
	from /app/vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/faraday/response.rb:8:in `call'
	from /app/vendor/bundle/ruby/2.2.0/gems/basecrm-1.2.3/lib/basecrm/middlewares/oauth_bearer_token.rb:13:in `call'
	from /app/vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/faraday/rack_builder.rb:139:in `build_response'
	from /app/vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/faraday/connection.rb:377:in `run_request'
	from /app/vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/faraday/connection.rb:140:in `get'
	from /app/vendor/bundle/ruby/2.2.0/gems/basecrm-1.2.3/lib/basecrm/http_client.rb:67:in `request'
	from /app/vendor/bundle/ruby/2.2.0/gems/basecrm-1.2.3/lib/basecrm/http_client.rb:66:in `instance_eval'
	from /app/vendor/bundle/ruby/2.2.0/gems/basecrm-1.2.3/lib/basecrm/http_client.rb:66:in `request'
	from /app/vendor/bundle/ruby/2.2.0/gems/basecrm-1.2.3/lib/basecrm/http_client.rb:34:in `get'
	from /app/vendor/bundle/ruby/2.2.0/gems/basecrm-1.2.3/lib/basecrm/services/deals_service.rb:41:in `where'
	from /app/app/helpers/basecrm_client.helper.rb:226:in `create_message_note_for_deal'
	from /app/app/helpers/basecrm_client.helper.rb:145:in `create_sms_note'
	from /app/app/models/contact_us_chat.rb:319:in `block in update_sales_text_metadata'

I know a deal fulfilling this criteria already exists by the time I run the query.

@efedasz
Copy link
Contributor

efedasz commented Jan 11, 2018

Hi @asafigan, @Swizec
This issue has been resolved in version 1.3.2
https://rubygems.org/gems/basecrm/versions/1.3.2

@efedasz efedasz closed this as completed Jan 11, 2018
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

3 participants