Commit 9275eeaa authored by caoyixiong's avatar caoyixiong Committed by 彭勇升 pengys
Browse files

FIx NPE in InstanceMetricAlarmAssertWorker (#1614)

* add user

* add user

* FIx NPE in InstanceMetricAlarmAssertWorker
parent cfee02cb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();
        }