Add error handling for getting stat 04/112304/1
authorKyungwook Tak <k.tak@samsung.com>
Tue, 31 Jan 2017 05:23:00 +0000 (14:23 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Tue, 31 Jan 2017 05:23:25 +0000 (14:23 +0900)
Change-Id: I1b8464ebfb3af33a48325af42595512dcba2284a
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
src/framework/service/file-system.cpp

index 28a078c..9ae2380 100644 (file)
@@ -303,6 +303,11 @@ void FsVisitor::run(const DirPtr &dirptr, const FilePtr &currentdir)
                                continue;
 
                        auto stat = getStat(fullpath);
+                       if (stat == nullptr) {
+                               WARN("Skip the file(" << fullpath << ") whose stat can't be retrieved");
+                               continue;
+                       }
+
                        if (S_ISREG(stat->st_mode))
                                this->visitFile(fullpath, currentdir);
                        else if (S_ISDIR(stat->st_mode))