diff --git a/NEWS b/NEWS index 1764f7ccf..3abc862b0 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Bug fixes - fixed the reply/forward operation over ActiveSync (#2805) - fixed regression when attaching files to a reply - wait 20 seconds (instead of 2) before deleting temporary download forms (#2811) + - avoid raising exceptions when the db is down and we try to access the preferences module (#2813) 2.2.5 (2014-06-05) ------------------ diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 3f626bc61..b0110f58d 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -329,17 +329,24 @@ static NSArray *childRecordFields = nil; fc = [cm acquireOpenChannelForURL: folderLocation]; if (fc) { - sql - = [NSString stringWithFormat: (@"SELECT c_foldername FROM %@" - @" WHERE c_path = '%@'"), - [folderLocation gcsTableName], ocsPath]; - [fc evaluateExpressionX: sql]; - attrs = [fc describeResults: NO]; - row = [fc fetchAttributes: attrs withZone: NULL]; - if (row) - [self _setDisplayNameFromRow: row]; - [fc cancelFetch]; - [cm releaseChannel: fc]; + // We use an exception handler here in case the database is down when + // performing the query. This could have unexpected results. + NS_DURING + { + sql + = [NSString stringWithFormat: (@"SELECT c_foldername FROM %@" + @" WHERE c_path = '%@'"), + [folderLocation gcsTableName], ocsPath]; + [fc evaluateExpressionX: sql]; + attrs = [fc describeResults: NO]; + row = [fc fetchAttributes: attrs withZone: NULL]; + if (row) + [self _setDisplayNameFromRow: row]; + [fc cancelFetch]; + [cm releaseChannel: fc]; + } + NS_HANDLER; + NS_ENDHANDLER; } }