Skip to content

Error selecting contact TypeError: Cannot read properties of undefined (reading 'errors') #11435

Description

@kennsippell

Describe the bug
Crash when selecting contact makes it impossible to select some contacts

To Reproduce
https://nairobi.echis.go.ke/#/contacts/1c86192c-c532-52ff-bc41-ff48fa9ecc33

Expected behavior
Can see it

Logs

main.js:1 Error selecting contact TypeError: Cannot read properties of undefined (reading 'errors')
    at main.js:1:2900286
    at Array.forEach (<anonymous>)
    at main.js:1:2900260
    at U.invoke (polyfills.js:1:24482)
    at xt.run (polyfills.js:1:19057)
    at polyfills.js:1:31184
    at U.invokeTask (polyfills.js:1:25102)
    at xt.runTask (polyfills.js:1:19718)
    at Re (polyfills.js:1:27361)

Screenshots

Environment

  • Instance: nairobi
  • Browser: *
  • Client platform: *
  • App: webapp
  • Version: 5.3.0

Additional context

  return this.searchService
    .search('reports', { subjectIds }, { include_docs: true, limit: this.LIMIT_SELECT_ALL_REPORTS })
    .then(reports => { 
      reports.forEach(report => {
        report.valid = !report.errors || !report.errors.length;   // <-- report is undefined

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: BugFix something that isn't working as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions