From 2cbca98658ba84dbba19e0380bbfe64bb30ec899 Mon Sep 17 00:00:00 2001 From: "chitta.rs" Date: Tue, 23 Apr 2013 19:08:49 +0530 Subject: [PATCH] Nabi issue(N_SE-36014) fix Change-Id: I26963cc200dd7fcaab7d38407ffca86f7f92640a --- src/MfFileManageWorkerThread.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/MfFileManageWorkerThread.cpp b/src/MfFileManageWorkerThread.cpp index f3cdeab..1e96cf1 100644 --- a/src/MfFileManageWorkerThread.cpp +++ b/src/MfFileManageWorkerThread.cpp @@ -393,12 +393,15 @@ FileManageWorkerThread::DeleteFolderEntry(void) Integer* pTotalFileCount = null; Integer* pFileManagingResult = null; Integer* pFolderEntryDeleteIndex = null; - IMapEnumerator* pMapEnum = __pListOfFiles->GetMapEnumeratorN(); - + IMapEnumerator* pMapEnum = null; ArrayList* pDeletedFolderEntry = null; + int count = 0; + + TryCatch(__pListOfFiles!=null ,r= E_FAILURE,"Checked map is null"); + pMapEnum = __pListOfFiles->GetMapEnumeratorN(); + pDeletedFolderEntry = new (std::nothrow) ArrayList(); pDeletedFolderEntry->Construct(); - int count = 0; if (pMapEnum != null) { @@ -407,7 +410,7 @@ FileManageWorkerThread::DeleteFolderEntry(void) if (__threadRunningState == THREAD_RUNNING_STATE_ALIVE) { pDir = static_cast< DirectoryEntry* >(pMapEnum->GetValue()); - TryCatch(pDir != null, , "directory retrieval falied"); + TryCatch(pDir != null, , "directory retrieval failed"); r = DeleteFileContentDB(pDir->GetFullFilePath()); TryCatch(r == E_SUCCESS || r == E_THREAD_CANCEL, , " delete file failed"); @@ -418,8 +421,9 @@ FileManageWorkerThread::DeleteFolderEntry(void) } pFolderEntryDeleteIndex = static_cast< Integer* >(pMapEnum->GetKey()); - pDeletedFolderEntry->Add((new Integer(pFolderEntryDeleteIndex->ToInt()))); + TryCatch(pFolderEntryDeleteIndex!=null ,r= E_FAILURE,"Checked map is null"); + pDeletedFolderEntry->Add((new Integer(pFolderEntryDeleteIndex->ToInt()))); count++; @@ -431,6 +435,8 @@ FileManageWorkerThread::DeleteFolderEntry(void) pFileManagingResult = new (std::nothrow) Integer(__fileManagingingResult); //pFolderEntryDeleteIndex = new (std::nothrow) Integer(0); pFileManagedCounter = new (std::nothrow) Integer(count); + + TryCatch(__pListOfFiles!=null ,r= E_FAILURE,"Checked map is null"); pTotalFileCount = new (std::nothrow) Integer(__pListOfFiles->GetCount()); pArg->Add(pFileManagingResult); -- 2.7.4