mmappcomponents/harvester/filehandler/src/mpxfolderscanner.cpp
branchRCL_3
changeset 56 63223d4fd956
parent 55 6c1dfe4da5dd
--- a/mmappcomponents/harvester/filehandler/src/mpxfolderscanner.cpp	Tue Aug 31 15:41:40 2010 +0300
+++ b/mmappcomponents/harvester/filehandler/src/mpxfolderscanner.cpp	Wed Sep 01 12:23:05 2010 +0100
@@ -192,6 +192,14 @@
         do
             {
             TRAP(err, iDirScan->NextL(iDir));
+            if( !iDir && !err ) 
+                {
+                // if iDir NULL and no error, there are no 
+                // more directories in the structure
+                // in this case there is no leaving functions called before
+                // returning err has to be 0
+                break;
+                }
             blocked = iObserver.IsPathBlockedL( iDirScan->FullPath() );
             if( blocked )
                 {
@@ -246,6 +254,14 @@
                 {
                 MPX_DEBUG1("CMPXFolderScanner::SetupNextDriveToScanL iDirScan->NextL()");
                 TRAP(err, iDirScan->NextL(iDir));
+                if( !iDir && !err ) 
+                    {
+                    // if iDir NULL and no error, there are no 
+                    // more directories in the structure
+                    // in this case there is no leaving functions called before
+                    // returning err has to be 0
+                    break;
+                    }
                 MPX_DEBUG2("CMPXFolderScanner::SetupNextDriveToScanL path %S", &iDirScan->FullPath());
                 blocked = iObserver.IsPathBlockedL( iDirScan->FullPath() );
                 MPX_DEBUG2("CMPXFolderScanner::SetupNextDriveToScanL path blocked %i", blocked);