From 24e215ea88f933ab341c871f355b3d9ae8ef3e67 Mon Sep 17 00:00:00 2001 From: jongmyeongko Date: Wed, 12 Jul 2017 15:42:29 +0900 Subject: [PATCH] Skip reading icon in case there is no icon file actually Change-Id: I653a8ac1d6fa1d496060adfd68ad8b1757814144 Signed-off-by: jongmyeongko --- src/lib/wgt_archive_info.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/wgt_archive_info.cc b/src/lib/wgt_archive_info.cc index 205ba5f..095b60d 100644 --- a/src/lib/wgt_archive_info.cc +++ b/src/lib/wgt_archive_info.cc @@ -140,6 +140,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); -- 2.7.4