mtpfws/mtpfw/src/cmtpobjectstore.cpp
changeset 18 1b39655331a3
parent 17 aabe5387f5ce
child 20 6e82ae192c3a
--- a/mtpfws/mtpfw/src/cmtpobjectstore.cpp	Fri Mar 19 09:40:39 2010 +0200
+++ b/mtpfws/mtpfw/src/cmtpobjectstore.cpp	Fri Apr 16 15:51:48 2010 +0300
@@ -861,7 +861,7 @@
 	else
 		{
 		err = OpenDb(fullName);
-		if (iDatabase.IsDamaged())
+		if (err==KErrNone && iDatabase.IsDamaged())
 			{
 			err = iDatabase.Recover();
 			}
@@ -1208,7 +1208,7 @@
                 TFileName suid;
 				if (colliItem->iSuid == NULL)
 					{
-					if (!LocateByHandleL(colliItem->iObjHandleId))
+					if (LocateByHandleL(colliItem->iObjHandleId))
 					    {
 					    DbColReadStreamL(iBatched, EObjectStoreSUID, suid);