(js) Fix exception when no match in AB search

pull/210/head
Francis Lachapelle 2016-05-18 08:30:22 -04:00
parent 4b0fadbe22
commit 7fe576f277
1 changed files with 6 additions and 4 deletions

View File

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