From 8b28a1f73c7191e714223f1c2724f95f2d256fd7 Mon Sep 17 00:00:00 2001 From: Jakub Izydorczyk Date: Fri, 6 Mar 2015 13:12:53 +0100 Subject: [PATCH] Remove assert checking for existance of widget package file Remove assert, which checks if widget package file exsits and replace it with checks from boost lib for file existence and return error on failure. Change-Id: I75dd117d85bef0fe1313da8a2510fe5bd6673dc7 --- src/common/step/step_unzip.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/step/step_unzip.cc b/src/common/step/step_unzip.cc index 4f36052..225dddd 100644 --- a/src/common/step/step_unzip.cc +++ b/src/common/step/step_unzip.cc @@ -216,7 +216,11 @@ Step::Status StepUnzip::ExtractToTmpDir(const char* src, Step::Status StepUnzip::process() { assert(!context_->file_path.get().empty()); - assert(!access(context_->file_path.get().c_str(), F_OK)); + if (!boost::filesystem::exists(context_->file_path.get())) { + LOG(ERROR) << "Specified widget does not exist: " + << context_->file_path.get(); + return Step::Status::ERROR; + } bf::path tmp_dir = GenerateTmpDir(context_->root_application_path.get()); -- 2.7.4