omaprovisioning/provisioning/ProvisioningEngine/Src/CWPInternetAPDB.cpp
changeset 63 e0c1916b8ddc
parent 0 b497e44ab2fc
child 62 19bba8228ff0
--- a/omaprovisioning/provisioning/ProvisioningEngine/Src/CWPInternetAPDB.cpp	Wed Aug 18 10:39:36 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningEngine/Src/CWPInternetAPDB.cpp	Thu Sep 02 21:22:11 2010 +0300
@@ -241,9 +241,9 @@
     Myview.Prepare(iItemsDatabase, TDbQuery(QueryBuffer));
     CleanupClosePushL(Myview);
     Myview.EvaluateAll();
-    Myview.FirstL();
-
-    while (Myview.AtRow())
+    if ( Myview.FirstL())
+    {
+    	while (Myview.AtRow())
         {
         Myview.GetL();
 
@@ -256,6 +256,7 @@
         aItemArray.Append(AccessPointItem);
         Myview.NextL();
         }
+    }
 
     CleanupStack::PopAndDestroy(); // Myview
     FLOG( _L( "[Provisioning] CWPInternetAPDB::ReadItemsL: done" ) );
@@ -323,9 +324,9 @@
     CleanupClosePushL(Myview);
 
     Myview.EvaluateAll();
-    Myview.FirstL();
-
-    if (!Myview.IsEmptyL())
+    if( Myview.FirstL())
+    {
+    	if (!Myview.IsEmptyL())
         {
         // we have autoincrement in index so it should be unique
         // but just to make sure, we use 'while', instead of 'if'
@@ -341,6 +342,7 @@
         iItemsDatabase.Compact();
         rowsdeleted = ETrue;
         }
+    }
     CleanupStack::PopAndDestroy(1); // Myview
 
     FLOG( _L( "[Provisioning] CWPInternetAPDB::DeleteFromDatabaseL: done" ) );