diff options
| -rw-r--r-- | src/JSONManifestBuilder.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/JSONManifestBuilder.cc b/src/JSONManifestBuilder.cc index 46a8518..50850f5 100644 --- a/src/JSONManifestBuilder.cc +++ b/src/JSONManifestBuilder.cc @@ -14,11 +14,16 @@ using namespace BTB; /// @brief Builds a JSON target from a JSON file. /// @param arg_sz filename size (must be 1 or greater). /// @param arg_val filename path (must be a valid JSON file). -/// @retval true succeeded building. +/// @retval true building has succeeded. /// @retval false fail to build, see error message. bool JSONManifestBuilder::buildTarget(int arg_sz, const char* arg_val, const bool dry_run) { String path; + if (!arg_val) { + BTB::Logger::info() << "btb: error: file path is empty" << std::endl; + return false; + } + if (arg_sz < 0) { BTB::Logger::info() << "btb: error: file path is empty" << std::endl; return false; |
