mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbabstractalbum.cpp
changeset 29 8192e5b5c935
parent 25 3ec52facab4d
child 38 b93f525c9244
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbabstractalbum.cpp	Fri May 14 15:49:53 2010 +0300
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbabstractalbum.cpp	Thu May 27 12:49:57 2010 +0300
@@ -252,7 +252,7 @@
 // ----------------------------------------------------------------------------
 //
 void CMPXDbAbstractAlbum::HandleTNL( const TDesC& aOldPath,
-        const TDesC& aNewPath, TInt aPriority )
+        const TDesC& aNewPath, TInt /*aPriority*/ )
   {
   MPX_FUNC("CMPXDbAbstractAlbum::HandleTNL");
 
@@ -324,13 +324,19 @@
 
     RSqlStatement recordset(GetCategoryRecordL(aId));
     CleanupClosePushL(recordset);
-
-    if (recordset.Next() != KSqlAtRow)
+    HBufC* uri = NULL;
+    if (recordset.Next() == KSqlAtRow)
+        {
+        uri = MPXDbCommonUtil::GetColumnTextL(recordset, EAbstractAlbumUri).AllocL();     
+        }
+    else
         {
-        User::LeaveIfError(KErrNotFound);
+        //entry is deleted due to garbage collection 
+        MPX_DEBUG1("CMPXDbAbstractAlbum::GetUriL, no uri, entry is deleted due to garbage collection"); 
+        TPtrC nullUri(KNullDesC);
+        uri = nullUri.AllocL();
         }
-    HBufC* uri = MPXDbCommonUtil::GetColumnTextL(recordset, EAbstractAlbumUri).AllocL();
-    CleanupStack::PopAndDestroy(&recordset);
+    CleanupStack::PopAndDestroy(&recordset);    
     return uri;
     }