Fixed issue 47036
[apps/osp/Gallery.git] / src / GlContentUpdateEventListener.cpp
index 818f175..3291261 100644 (file)
@@ -164,13 +164,17 @@ ContentUpdateEventListener::OnContentFileCreated(Tizen::Content::ContentId conte
        if (contentType == CONTENT_TYPE_IMAGE || contentType == CONTENT_TYPE_VIDEO)
        {
                Tizen::Content::ContentInfo* cntInfo = __pContentManager->GetContentInfoN(contentId);
-               String path = cntInfo->GetContentPath();
-               String dirName = GetDirecotyNameFromFullPath(path);
 
-               FileListPresentationModel* pFileListPM = FileListPresentationModel::GetInstance();
-               pFileListPM->AddDirectoryIfNew(dirName);
-               AlbumListPresentationModel::GetInstance()->OnContentCreated();
-               pFileListPM->OnContentCreated();
+               if ( cntInfo != NULL)
+               {
+                       String path = cntInfo->GetContentPath();
+                       String dirName = GetDirecotyNameFromFullPath(path);
+
+                       FileListPresentationModel* pFileListPM = FileListPresentationModel::GetInstance();
+                       pFileListPM->AddDirectoryIfNew(dirName);
+                       AlbumListPresentationModel::GetInstance()->OnContentCreated();
+                       pFileListPM->OnContentCreated();
+               }
        }
 
        AppLogDebug("EXIT");