Skip to content

Commit c242b31

Browse files
committed
Fix issue with backport in 641df53
inline scripts use the propery "inline" in 5.x
1 parent 9a8e297 commit c242b31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Nest/XPack/Watcher/Transform/ScriptTransformBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
6464
if (!dict.HasAny()) return null;
6565

6666
IScriptTransform scriptTransform = null;
67-
if (dict.TryGetValue("source", out JToken sourceToken))
67+
if (dict.TryGetValue("inline", out var inlineToken))
6868
{
69-
var inline = sourceToken.ToString();
69+
var inline = inlineToken.ToString();
7070
scriptTransform = new InlineScriptTransform(inline);
7171
}
7272
else if (dict.TryGetValue("file", out var fileToken))
7373
{
7474
var file = fileToken.ToString();
7575
scriptTransform = new FileScriptTransform(file);
7676
}
77-
else if (dict.TryGetValue("id", out JToken idToken))
77+
else if (dict.TryGetValue("id", out var idToken))
7878
{
7979
var id = idToken.ToString();
8080
scriptTransform = new IndexedScriptTransform(id);

0 commit comments

Comments
 (0)