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

TypeError: Cannot read property 'service' of undefined #17

Open
Snapu opened this issue Feb 22, 2017 · 1 comment · May be fixed by #19
Open

TypeError: Cannot read property 'service' of undefined #17

Snapu opened this issue Feb 22, 2017 · 1 comment · May be fixed by #19

Comments

@Snapu
Copy link

Snapu commented Feb 22, 2017

On the spaceDetails page, services can't be loaded due to the following error:

libs.min.js:100 TypeError: Cannot read property 'service' of undefined
    at application.min.js:3
    at Object.s [as forEach] (libs.min.js:7)
    at application.min.js:3
    at libs.min.js:109
    at h.$eval (libs.min.js:123)
    at h.$digest (libs.min.js:120)
    at h.$apply (libs.min.js:123)
    at n (libs.min.js:80)
    at O (libs.min.js:84)
    at XMLHttpRequest.D.onload (libs.min.js:85)

It is this part of the code:

        angular.forEach(response.data.services, function(service, i) {
          var objectService = {
            id: service.guid,
            name: service.name,
            servicePlan: service.service_plan.service.label + ', ' + service.service_plan.name,
            nrOfBoundApps: service.bound_app_count,
            dashboardUrl: service.dashboard_url,
            supportURL:'https://support.'+service.service_plan.service.label+'.com/',
            docsURL: 'http://docs.run.pivotal.io/marketplace/services/'+service.service_plan.service.label+'.html'
          };

Don't know if it is a general bug. Anyway, I am trying to fix it now.

@Snapu
Copy link
Author

Snapu commented Feb 22, 2017

Ok I see.. user-provided services do not have a service_plan field. That's why it crashes. You should check whether the service has a service_plan field and if not display -user-provides- or just skip it.

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

Successfully merging a pull request may close this issue.

1 participant