From 758b671ca07617cee3eef8497897d260aab1bea6 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Thu, 19 Sep 2024 11:59:20 -0400 Subject: [PATCH] Check stream version Signed-off-by: Craig Perkins --- server/src/main/java/org/opensearch/plugins/PluginInfo.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/plugins/PluginInfo.java b/server/src/main/java/org/opensearch/plugins/PluginInfo.java index d39067c976807..7adefb8c7b1bb 100644 --- a/server/src/main/java/org/opensearch/plugins/PluginInfo.java +++ b/server/src/main/java/org/opensearch/plugins/PluginInfo.java @@ -217,7 +217,11 @@ public PluginInfo(final StreamInput in) throws IOException { this.customFolderName = in.readString(); this.extendedPlugins = in.readStringList(); this.hasNativeController = in.readBoolean(); - this.requestedActions = Settings.readSettingsFromStream(in); + if (in.getVersion().onOrAfter(Version.V_2_18_0)) { + this.requestedActions = Settings.readSettingsFromStream(in); + } else { + this.requestedActions = Settings.EMPTY; + } } @Override