diff options
| author | nicktitov <[email protected]> | 2025-11-26 09:20:26 +0300 |
|---|---|---|
| committer | nicktitov <[email protected]> | 2025-11-26 09:33:39 +0300 |
| commit | fd10a2603c35aefac37abd55c2062844e8ea3628 (patch) | |
| tree | 8efcbbd2b9ff443175ea558dc6b131e1d436245f /library/cpp/testing | |
| parent | 0cb0f05e90c181852cadf7f3a676defeee9e775c (diff) | |
Update env contract to deal with null
В продолжение <https://nda.ya.ru/t/Zv2eRt4A7Ncwc7>
Поддерживаем контракт в env.cpp (используется в BinaryPath), т.к. он тоже строит из `env.json.txt` окружение и при обнаружении Null падает
commit_hash:6d01c031662f29c665a54fe4f4036a3bf7dea99a
Diffstat (limited to 'library/cpp/testing')
| -rw-r--r-- | library/cpp/testing/common/env.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/library/cpp/testing/common/env.cpp b/library/cpp/testing/common/env.cpp index 41bf2b20aba..a536aab2a7b 100644 --- a/library/cpp/testing/common/env.cpp +++ b/library/cpp/testing/common/env.cpp @@ -224,7 +224,12 @@ namespace NPrivate { while (file.ReadLine(ljson) > 0) { NJson::ReadJsonTree(ljson, &envVar); for (const auto& entry : envVar.GetMap()) { - SetEnv(entry.first, entry.second.GetStringSafe("")); + auto value = entry.second; + if (value.GetType() == NJson::JSON_NULL) { + UnsetEnv(entry.first); + } else { + SetEnv(entry.first, value.GetStringSafe("")); + } } } } |
