Skip to content

If the server returned an empty array for a get request (valid scenario), angular-data throws an exception #225

Closed
@Varada

Description

@Varada

In the inject function - there is code to the effect of

            if (options.linkInverse) {
                if (DS.utils.isArray(injected) && injected.length) {
                        DS.linkInverse(definition.name, injected[0][definition.idAttribute]);
                 }
                 else {
                    DS.linkInverse(definition.name, injected[definition.idAttribute]);
                }
            }

In this scenario, the get returns an array - but its length is 0. Now the code attempts to look it up in the else clause as an object and throws exception

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions