Skip to content

Commit 5691315

Browse files
author
Andrey Ershov
committed
BwC fix 2
1 parent 0567239 commit 5691315

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,11 @@ private SnapshotInfo(SnapshotId snapshotId, String repository, List<String> indi
283283
public SnapshotInfo(final StreamInput in) throws IOException {
284284
snapshotId = new SnapshotId(in);
285285
if (in.getVersion().onOrAfter(GetSnapshotsRequest.MULTIPLE_REPOSITORIES_SUPPORT_ADDED)) {
286-
repository = in.readString();
286+
if (in.readBoolean()) {
287+
repository = in.readString();
288+
} else {
289+
repository = null;
290+
}
287291
} else {
288292
repository = null;
289293
}
@@ -694,7 +698,12 @@ public static SnapshotInfo fromXContentInternal(final XContentParser parser) thr
694698
public void writeTo(final StreamOutput out) throws IOException {
695699
snapshotId.writeTo(out);
696700
if (out.getVersion().onOrAfter(GetSnapshotsRequest.MULTIPLE_REPOSITORIES_SUPPORT_ADDED)) {
697-
out.writeString(repository);
701+
if (repository != null) {
702+
out.writeBoolean(true);
703+
out.writeString(repository);
704+
} else {
705+
out.writeBoolean(false);
706+
}
698707
}
699708
out.writeVInt(indices.size());
700709
for (String index : indices) {

0 commit comments

Comments
 (0)