fix: 修改未知进程返回 空字符串

This commit is contained in:
fangshunjian
2022-09-19 14:14:47 +08:00
parent e70e687298
commit d23a48be48

View File

@@ -209,9 +209,9 @@ public class OSHIUtils {
map.put("receiveQueue",connection.getReceiveQueue());
if (connection.getowningProcessId() == -1 ){
//未知进程 getowningProcessId 返回 -1 为避免获取进程name error
map.put("processId","unknown");
map.put("processName","unknown");
map.put("processCmd","unknown");
map.put("processId",-1);
map.put("processName","");
map.put("processCmd","");
}else {
map.put("processId",connection.getowningProcessId());
map.put("processName",operatingSystem.getProcess(connection.getowningProcessId()).getName());