Skip reading icon in case there is no icon file actually 14/138414/2
authorjongmyeongko <jongmyeong.ko@samsung.com>
Wed, 12 Jul 2017 06:41:19 +0000 (15:41 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Wed, 12 Jul 2017 06:43:45 +0000 (06:43 +0000)
Change-Id: I0a009854533c3ed37906de8452c7385cd62b0125
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/lib/tpk_archive_info.cc

index e3b9a53..890a038 100644 (file)
@@ -209,6 +209,11 @@ bool ReadIcon(const bf::path& icon, const bf::path& tmp_dir,
 
   LOG(INFO) << "Icon file path: " << icon_path;
 
+  if (!bf::exists(icon_path)) {
+    LOG(WARNING) << "Icon file doesn't actually exist, skip reading icon";
+    return true;
+  }
+
   std::ifstream ifs(icon_path.c_str(),
       std::ifstream::in | std::ifstream::binary);
   ifs.seekg(0, ifs.end);