From bf02a6b4741f84db0ca227f6c875a9eaf04161bf Mon Sep 17 00:00:00 2001 From: yanzhiqi1 Date: Sun, 4 Aug 2024 21:33:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=91=8A=E8=AD=A6=E6=B8=85?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yanzhiqi1 Change-Id: Ifc37c54753654d71fbd43a149c80ed4606d35897 --- tooling/client/utils/cli_command.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tooling/client/utils/cli_command.cpp b/tooling/client/utils/cli_command.cpp index 8e8f594d..011001b3 100644 --- a/tooling/client/utils/cli_command.cpp +++ b/tooling/client/utils/cli_command.cpp @@ -240,6 +240,10 @@ ErrCode CliCommand::HeapProfilerCommand(const std::string &cmd) std::cout << "exe success, cmd is " << cmd << std::endl; } else { const std::string &arg = argList[0]; + if (arg.empty()) { + std::cout << "The folder path is empty" << std::endl; + return ErrCode::ERR_FAIL; + } std::string pathDump = arg; std::ifstream fileExit(pathDump.c_str()); if (fileExit.good() && (pathDump[0] == pathDump[pathDump.size()-1]) && (GetArgList().size() == 1)) { -- Gitee