Skip to content

Commit

Permalink
Bug 981327 - [JavaScript Error: 'TypeError: item is undefined' {file:…
Browse files Browse the repository at this point in the history
… app://communications.gaiamobile.org/shared/js/binary_search.js line: 26}]
  • Loading branch information
jmcanterafonseca committed Mar 10, 2014
1 parent 2bb8e31 commit 799ef56
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions shared/js/fb/fb_data_reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,14 @@ this.fb = fb;
window.console.warn('The datastore is empty and readonly');
}
return null;
}).then(function add_index_success(v) {
}).then(function add_index_success(result) {
// Index is created in order not to cause errors
if (typeof v !== 'number') {
setIndex(v);
if (typeof result !== 'number') {
// Guaranteeing that treeTel is always an Array
if (!Array.isArray(result.treeTel)) {
result.treeTel = [];
}
setIndex(result);
}
revisionId = datastore.revisionId;
notifyOpenSuccess(cb);
Expand Down

0 comments on commit 799ef56

Please sign in to comment.