diff --git a/src/main/java/org/elasticsearch/action/update/UpdateRequest.java b/src/main/java/org/elasticsearch/action/update/UpdateRequest.java index a01beb7fc60..b839002740a 100644 --- a/src/main/java/org/elasticsearch/action/update/UpdateRequest.java +++ b/src/main/java/org/elasticsearch/action/update/UpdateRequest.java @@ -651,7 +651,7 @@ public class UpdateRequest extends InstanceShardOperationRequest out.writeString(id); out.writeOptionalString(routing); out.writeOptionalString(script); - if (script != null) { + if (script != null && out.getVersion().onOrAfter(Version.V_1_3_0)) { ScriptService.ScriptType.writeTo(scriptType, out); } out.writeOptionalString(scriptLang);