FIx NPE in InstanceMetricAlarmAssertWorker (#1614)
* add user * add user * FIx NPE in InstanceMetricAlarmAssertWorker
This commit is contained in:
parent
cfee02cbf5
commit
9275eeaa7a
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue