!198 针对I8NT4S 的issue修复bug

Merge pull request !198 from 周冰/dev_zhoubing
This commit is contained in:
蒋小小 2023-12-15 10:06:03 +00:00 committed by Gitee
commit abd6346cfd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -361,10 +361,10 @@ public class CommandUtil {
processBuilder.redirectErrorStream(true);
processBuilder.command(command);
Optional.ofNullable(baseDir).ifPresent(processBuilder::directory);
Map<String, String> environment = processBuilder.environment();
// 新增逻辑,将env和environment里value==null替换成空字符,防止putAll出现空指针报错
env.replaceAll((k,v)-> Optional.ofNullable(v).orElse(StrUtil.EMPTY));
environment.replaceAll((k,v)-> Optional.ofNullable(v).orElse(StrUtil.EMPTY));
Map<String, String> environment = processBuilder.environment();
// 环境变量
Optional.ofNullable(env).ifPresent(environment::putAll);
//