From 1ebf3dc64369b0dea2c8ee328b342111640af1dc Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 11 Jun 2012 22:13:45 +0200 Subject: [PATCH] Fix js for missing address fields. --- js/contacts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/contacts.js b/js/contacts.js index a2418563..6b83504c 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -839,22 +839,22 @@ Contacts={ $('#addressdisplay dl').last().data('checksum', this.data.ADR[adr]['checksum']); var adrarray = this.data.ADR[adr]['value']; var adrtxt = ''; - if(adrarray[0].length > 0) { + if(adrarray[0] && adrarray[0].length > 0) { adrtxt = adrtxt + '
  • ' + adrarray[0].strip_tags() + '
  • '; } - if(adrarray[1].length > 0) { + if(adrarray[1] && adrarray[1].length > 0) { adrtxt = adrtxt + '
  • ' + adrarray[1].strip_tags() + '
  • '; } - if(adrarray[2].length > 0) { + if(adrarray[2] && adrarray[2].length > 0) { adrtxt = adrtxt + '
  • ' + adrarray[2].strip_tags() + '
  • '; } - if(adrarray[3].length > 0 || adrarray[5].length > 0) { + if((adrarray[3] && adrarray[5]) && adrarray[3].length > 0 || adrarray[5].length > 0) { adrtxt = adrtxt + '
  • ' + adrarray[5].strip_tags() + ' ' + adrarray[3].strip_tags() + '
  • '; } - if(adrarray[4].length > 0) { + if(adrarray[4] && adrarray[4].length > 0) { adrtxt = adrtxt + '
  • ' + adrarray[4].strip_tags() + '
  • '; } - if(adrarray[6].length > 0) { + if(adrarray[6] && adrarray[6].length > 0) { adrtxt = adrtxt + '
  • ' + adrarray[6].strip_tags() + '
  • '; } $('#addressdisplay dl').last().find('.addresslist').html(adrtxt);