From 7556d4fe7a55272827fa8892ca4b1dcd547167b5 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 15 Jul 2011 15:08:30 +0000 Subject: [PATCH] Monotone-Parent: 7cfdd064893329db0adaa6d3f8e376f93037427b Monotone-Revision: 94165b609bb149d80e4ea22d3eaa449726ba7e4c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-15T15:08:30 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ OpenChange/MAPIStoreFolder.m | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c43ab951..5768a7fde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * OpenChange/MAPIStoreFolder.m (-createFolder:withRow:andFID:): fixed referencing of resulting folder. (+initialize): fixed initialization of MAPIStoreFAIMessageK. + (-getTable:andRowCount:tableType:andHandleId:): properly return + MAPISTORE_ERR_NOT_FOUND for tables that are not handled by the + folder. 2011-07-14 Wolfgang Sourdeau diff --git a/OpenChange/MAPIStoreFolder.m b/OpenChange/MAPIStoreFolder.m index 24ddc5dc5..7e7d7173d 100644 --- a/OpenChange/MAPIStoreFolder.m +++ b/OpenChange/MAPIStoreFolder.m @@ -502,6 +502,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe tableType: (uint8_t) tableType andHandleId: (uint32_t) handleId { + int rc = MAPISTORE_SUCCESS; MAPIStoreTable *table; if (tableType == MAPISTORE_MESSAGE_TABLE) @@ -516,11 +517,16 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe [NSException raise: @"MAPIStoreIOException" format: @"unsupported table type: %d", tableType]; } - [table setHandleId: handleId]; - *tablePtr = table; - *countPtr = [[table childKeys] count]; + if (table) + { + [table setHandleId: handleId]; + *tablePtr = table; + *countPtr = [[table childKeys] count]; + } + else + rc = MAPISTORE_ERR_NOT_FOUND; - return MAPISTORE_SUCCESS; + return rc; } - (int) setProperties: (struct SRow *) aRow