fix seg fault arising when execute zello_sysman firmware

Seg fault is coming when execute zello_sysman firmware without
any argument. This change fixes it.

Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
Jitendra Sharma 2021-05-19 13:46:05 +00:00 committed by Compute-Runtime-Automation
parent 1d9bb9b214
commit 7bec5d5d3b
1 changed files with 3 additions and 1 deletions

View File

@ -1100,7 +1100,9 @@ int main(int argc, char *argv[]) {
break;
case 'i': {
std::string filePathFirmware;
filePathFirmware = optarg;
if (optarg != nullptr) {
filePathFirmware = optarg;
}
std::for_each(devices.begin(), devices.end(), [&](auto device) {
testSysmanFirmware(device, filePathFirmware);
});