Authored by DengXinFei

修复空指针异常隐患

@@ -78,6 +78,10 @@ public class ActivateUnionRest { @@ -78,6 +78,10 @@ public class ActivateUnionRest {
78 vo.setClient_type(ClientTypeEnum.IOS.getName()); 78 vo.setClient_type(ClientTypeEnum.IOS.getName());
79 } 79 }
80 String agent = request.getHeader("user-agent"); 80 String agent = request.getHeader("user-agent");
  81 + if(StringUtils.isEmpty(agent)){
  82 + log.warn("activateUnion failed. user-agent is null. agent is {}, request vo is {}", agent, vo);
  83 + return new UnionResponse(200,"success","user-agent is null");
  84 + }
81 String clientType = vo.getClient_type(); 85 String clientType = vo.getClient_type();
82 log.info("addMonitor user-agent={}", agent); 86 log.info("addMonitor user-agent={}", agent);
83 String[] arr = agent.split(";"); 87 String[] arr = agent.split(";");