Skip to content

EventDeck is constantly throwing errors #338

Description

@johnytiago

EventDeck is constantly throwing this error:

Debug: hapi, internal, implementation, error
    TypeError: Uncaught error: Cannot read property 'advertisementLvl' of undefined
    at renderObject (/home/production/eventdeck/server/views/company.js:32:129)
    at render (/home/production/eventdeck/server/views/company.js:15:10)
    at exports.get.handler (/home/production/eventdeck/server/routes/companies/handlers.js:99:11)
    at Object.internals.handler (/home/production/eventdeck/node_modules/hapi/lib/handler.js:91:27)
    ...

The problem comes from here at server/views/company.js:

advertisementLvl: model.participations.filter(function (p) { return p.advertisementLvl && p.status === PUBLIC_STATUS })[0].advertisementLvl¬

If there is no participation that passes the filter the array will be empty and therefore the error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions