提交 9275eeaa 编写于 作者: C caoyixiong 提交者: 彭勇升 pengys

FIx NPE in InstanceMetricAlarmAssertWorker (#1614)

* add user

* add user

* FIx NPE in InstanceMetricAlarmAssertWorker
上级 cfee02cb
......@@ -66,7 +66,7 @@ public class InstanceMetricAlarmAssertWorker extends AlarmAssertWorker<InstanceM
Instance instance = instanceDAO.getInstance(alarm.getInstanceId());
JsonObject osInfo = gson.fromJson(instance.getOsInfo(), JsonObject.class);
String serverName = Const.UNKNOWN;
if (osInfo.has("hostName")) {
if (osInfo != null && osInfo.has("hostName")) {
serverName = osInfo.get("hostName").getAsString();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册