Skip to content

Commit 4277480

Browse files
committed
Fix smoketest
1 parent 4a6c6c6 commit 4277480

File tree

1 file changed

+3
-1
lines changed
  • agent/agent-profiler/agent-alerting-api/src/main/java/com/microsoft/applicationinsights/alerting/alert

1 file changed

+3
-1
lines changed

agent/agent-profiler/agent-alerting-api/src/main/java/com/microsoft/applicationinsights/alerting/alert/AlertBreach.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ public static AlertBreach.Builder builder() {
8080
@Override
8181
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
8282
jsonWriter.writeStartObject();
83-
jsonWriter.writeStringField("type", type.name());
83+
if (type != null) {
84+
jsonWriter.writeStringField("type", type.name());
85+
}
8486
jsonWriter.writeDoubleField("alertValue", alertValue);
8587
jsonWriter.writeJsonField("alertConfiguration", alertConfiguration);
8688
jsonWriter.writeDoubleField("cpuMetric", cpuMetric);

0 commit comments

Comments
 (0)