Skip to content

Typeahead breaks if typeahead property receives NULL value #4417

Closed
@ghost

Description

The typeahead directive breaks if the [typeahead] property receives a NULL value (with NullPointerException). This happens since my async data service returns NULL instead of [] if no search results were found.

I'm wondering why NULL is not a valid value? In my opinion, the directive should catch undefined values by itself.

ERROR TypeError: Cannot read property 'slice' of null
    at TypeaheadDirective.push../node_modules/ngx-bootstrap/typeahead/typeahead.directive.js.TypeaheadDirective.prepareMatches (typeahead.directive.js:306)
...

ngx-bootstrap: 3.0.0
Angular: 6.0.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions