diff -r bdd9da0d70fe -r 1f1dad4af8f8 mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/src/mpxpodcastdbplugin.cpp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/src/mpxpodcastdbplugin.cpp Wed Sep 15 12:09:46 2010 +0300 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/src/mpxpodcastdbplugin.cpp Wed Oct 13 14:28:40 2010 +0300 @@ -3050,7 +3050,18 @@ } TInt drive = aCmd.ValueTObjectL(KMPXCommandCollectionCountDrive); - TInt count = (TInt)iDbHandler->GetTotalCountL(drive); + + TInt count = 0; + TRAPD( totalerr, count = (TInt)iDbHandler->GetTotalCountL(drive) ); + MPX_DEBUG2( "CMPXPodcastDbPlugin::DoGetCollectionCountL, totalerr =%d", totalerr ); + if ( totalerr == KErrCorrupt ) + { + iDbHandler->CloseDatabaseL( drive ); + iDbHandler->RecreateDatabaseFileL( drive ); + iDbHandler->OpenDatabaseL( drive ); + count = (TInt)iDbHandler->GetTotalCountL(drive); + } + ((CMPXMedia&)aCmd).SetTObjectValueL(KMPXCommandCollectionCountValue, count); }