summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniko <niko>2012-06-24 22:51:04 (GMT)
committerniko <niko>2012-06-24 22:51:04 (GMT)
commit1c04acc050076d5e5939dc94083d8ca876ffd603 (patch)
tree55764b4d6d1ffb228bdbb62e4291ddffd338a4a0
parenta192b45158dbfb8a8dae3d1b976555ef20e46e04 (diff)
downloadsynckolab-1c04acc050076d5e5939dc94083d8ca876ffd603.tar.gz
null checking
-rw-r--r--src/chrome/content/synckolab/addressbookTools.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/chrome/content/synckolab/addressbookTools.js b/src/chrome/content/synckolab/addressbookTools.js
index c514da3..568899b 100644
--- a/src/chrome/content/synckolab/addressbookTools.js
+++ b/src/chrome/content/synckolab/addressbookTools.js
@@ -1427,7 +1427,17 @@ com.synckolab.addressbookTools.equalsContact = function (a, b) {
com.synckolab.tools.logMessage(a.toSource() + " vs. " + b.toSource(), com.synckolab.global.LOG_DEBUG + com.synckolab.global.LOG_AB);
// length needs to be equal
- if (a.contacts.length !== b.contacts.length) {
+ if (a.contacts && b.contacts && a.contacts.length !== b.contacts.length) {
+ com.synckolab.tools.logMessage("different amount of contacts in each list", com.synckolab.global.LOG_DEBUG + com.synckolab.global.LOG_AB);
+ return false;
+ }
+
+ if(a.contacts && !b.contacts && a.contacts.length !== 0) {
+ com.synckolab.tools.logMessage("different amount of contacts in each list", com.synckolab.global.LOG_DEBUG + com.synckolab.global.LOG_AB);
+ return false;
+ }
+
+ if(!a.contacts && b.contacts && b.contacts.length !== 0) {
com.synckolab.tools.logMessage("different amount of contacts in each list", com.synckolab.global.LOG_DEBUG + com.synckolab.global.LOG_AB);
return false;
}