diff --git a/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt b/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt index 3a3a21e4..e4979407 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt @@ -363,7 +363,7 @@ data class Alert( } out.writeOptionalString(executionId) out.writeStringCollection(associatedAlertIds) - if (!clusters.isNullOrEmpty()) out.writeStringArray(clusters.toTypedArray()) + out.writeOptionalStringArray(clusters?.toTypedArray()) } companion object {