Merge pull request #246 from KomputeProject/245_null_debug

Fix for null debug log causing exception in fmt lib
This commit is contained in:
Alejandro Saucedo 2021-09-16 05:07:42 +01:00 committed by GitHub
commit cf94e53d09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,9 +179,9 @@ Manager::createInstance()
};
std::vector<std::string> envLayerNames;
const char* envLayerNamesVal = std::getenv("KOMPUTE_ENV_DEBUG_LAYERS");
KP_LOG_DEBUG("Kompute Manager adding environment layers: {}",
envLayerNamesVal);
if (envLayerNamesVal != NULL && *envLayerNamesVal != '\0') {
KP_LOG_DEBUG("Kompute Manager adding environment layers: {}",
envLayerNamesVal);
std::istringstream iss(envLayerNamesVal);
std::istream_iterator<std::string> beg(iss), end;
envLayerNames = std::vector<std::string>(beg, end);