(js) Fix exception when no match in AB search

This commit is contained in:
Francis Lachapelle 2016-05-18 08:30:22 -04:00
parent 4b0fadbe22
commit 7fe576f277

View file

@ -457,10 +457,12 @@
return this == card.id; return this == card.id;
}; };
if (response.headers) {
// First entry of 'headers' are keys // First entry of 'headers' are keys
fields = _.invokeMap(response.headers[0], 'toLowerCase'); fields = _.invokeMap(response.headers[0], 'toLowerCase');
idFieldIndex = fields.indexOf('id'); idFieldIndex = fields.indexOf('id');
response.headers.splice(0, 1); response.headers.splice(0, 1);
}
if (excludedCards) if (excludedCards)
// Remove excluded cards from results // Remove excluded cards from results