diff --git a/ChangeLog b/ChangeLog index 67ef23f81..50faafb16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-09-26 Wolfgang Sourdeau + * UI/Contacts/UIxContactEditor.m ([UIxContactEditor + -initSnapshot]): check if "[card n]" returns anything to avoid a + crash. + * UI/Common/UIxPageFrame.m ([UIxPageFrame -doctype]): new method that returns an unparsed doctype definition for the pages. diff --git a/UI/Contacts/UIxContactEditor.m b/UI/Contacts/UIxContactEditor.m index 30fbdf402..76ea1b709 100644 --- a/UI/Contacts/UIxContactEditor.m +++ b/UI/Contacts/UIxContactEditor.m @@ -259,11 +259,19 @@ { NSArray *n, *elements; CardElement *element; + unsigned int max; n = [card n]; - - [self _setSnapshotValue: @"sn" to: [n objectAtIndex: 0]]; - [self _setSnapshotValue: @"givenName" to: [n objectAtIndex: 1]]; + if (n) + { + max = [n count]; + if (max > 0) + { + [self _setSnapshotValue: @"sn" to: [n objectAtIndex: 0]]; + if (max > 1) + [self _setSnapshotValue: @"givenName" to: [n objectAtIndex: 1]]; + } + } [self _setSnapshotValue: @"fn" to: [card fn]]; [self _setSnapshotValue: @"nickname" to: [card nickname]];