Skip to content

[Bug] ThreeScale::Core::ServiceError.load_all - undefined method `map' for nil:NilClass #13

@Martouta

Description

@Martouta

When I load from system in development {{provider_url}}/apiconfig/errors, I see:
image
In case you want the stacktrace:

NoMethodError (undefined method `map' for nil:NilClass
Did you mean?  tap):
  app/services/integration_errors_service.rb:4:in `list'
  app/controllers/api/errors_controller.rb:13:in `block in index'
  app/controllers/api/errors_controller.rb:12:in `index'
  lib/three_scale/middleware/dev_domain.rb:25:in `call'
  lib/three_scale/middleware/dev_domain.rb:25:in `call'
  lib/three_scale/middleware/multitenant.rb:116:in `_call'
  lib/three_scale/middleware/multitenant.rb:111:in `call'

I can bypass it by changing this line:

APIClient::Collection.new(result[:attributes].map { |attrs| new attrs },

for:

APIClient::Collection.new((result[:attributes] || []).map { |attrs| new attrs },

but this is more a workaround to don't get stuck in what I have to do than an actual fix 😄 So just saying because it is not blocking or too urgent but it should be fixed at some point 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions