mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-31 20:52:17 +01:00
handle undefined contact - fixes #948
This commit is contained in:
parent
a44f4a55bb
commit
538bf08160
@ -15,17 +15,17 @@ OC.Contacts = OC.Contacts || {};
|
|||||||
*/
|
*/
|
||||||
var Contact = function(parent, id, metadata, data, listtemplate, dragtemplate, fulltemplate, detailtemplates) {
|
var Contact = function(parent, id, metadata, data, listtemplate, dragtemplate, fulltemplate, detailtemplates) {
|
||||||
//console.log('contact:', id, metadata, data); //parent, id, data, listtemplate, fulltemplate);
|
//console.log('contact:', id, metadata, data); //parent, id, data, listtemplate, fulltemplate);
|
||||||
this.parent = parent,
|
this.parent = parent;
|
||||||
this.storage = parent.storage,
|
this.storage = parent.storage;
|
||||||
this.id = id,
|
this.id = id;
|
||||||
this.metadata = metadata,
|
this.metadata = metadata;
|
||||||
this.data = data,
|
this.data = data;
|
||||||
this.$dragTemplate = dragtemplate,
|
this.$dragTemplate = dragtemplate;
|
||||||
this.$listTemplate = listtemplate,
|
this.$listTemplate = listtemplate;
|
||||||
this.$fullTemplate = fulltemplate;
|
this.$fullTemplate = fulltemplate;
|
||||||
this.detailTemplates = detailtemplates;
|
this.detailTemplates = detailtemplates;
|
||||||
this.displayNames = {};
|
this.displayNames = {};
|
||||||
this.sortOrder = contacts_sortby || 'fn';
|
this.sortOrder = contacts_sortby || 'fn';
|
||||||
this.undoQueue = [];
|
this.undoQueue = [];
|
||||||
this.multi_properties = ['EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'CLOUD'];
|
this.multi_properties = ['EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'CLOUD'];
|
||||||
};
|
};
|
||||||
@ -2309,13 +2309,15 @@ OC.Contacts = OC.Contacts || {};
|
|||||||
// Make a map of backends, address books and contacts for easier processing.
|
// Make a map of backends, address books and contacts for easier processing.
|
||||||
do {
|
do {
|
||||||
contact = this.deletionQueue.shift();
|
contact = this.deletionQueue.shift();
|
||||||
if(!contactMap[contact.getBackend()]) {
|
if (!_.isUndefined(contact)) {
|
||||||
contactMap[contact.getBackend()] = {};
|
if(!contactMap[contact.getBackend()]) {
|
||||||
|
contactMap[contact.getBackend()] = {};
|
||||||
|
}
|
||||||
|
if(!contactMap[contact.getBackend()][contact.getParent()]) {
|
||||||
|
contactMap[contact.getBackend()][contact.getParent()] = [];
|
||||||
|
}
|
||||||
|
contactMap[contact.getBackend()][contact.getParent()].push(contact.getId());
|
||||||
}
|
}
|
||||||
if(!contactMap[contact.getBackend()][contact.getParent()]) {
|
|
||||||
contactMap[contact.getBackend()][contact.getParent()] = [];
|
|
||||||
}
|
|
||||||
contactMap[contact.getBackend()][contact.getParent()].push(contact.getId());
|
|
||||||
} while(this.deletionQueue.length > 0);
|
} while(this.deletionQueue.length > 0);
|
||||||
console.log('map', contactMap);
|
console.log('map', contactMap);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user