From 10705cbe1e2d9766876a97ab1ca5130c52e7e437 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 26 Sep 2006 18:41:05 +0000 Subject: [PATCH] Monotone-Parent: 8d6e71b994b7d6f015c187ce841c7ffee79c5b0d Monotone-Revision: 9b75a56ce8daf9300f46778c1489c7a8d55088da Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-26T18:41:05 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Contacts/UIxContactEditor.m | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) 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]];