diff --git a/src/main/java/org/elasticsearch/cluster/routing/ImmutableShardRouting.java b/src/main/java/org/elasticsearch/cluster/routing/ImmutableShardRouting.java index 7553786fb9c..3253262fb42 100644 --- a/src/main/java/org/elasticsearch/cluster/routing/ImmutableShardRouting.java +++ b/src/main/java/org/elasticsearch/cluster/routing/ImmutableShardRouting.java @@ -341,12 +341,10 @@ public class ImmutableShardRouting implements Streamable, Serializable, ShardRou .field("node", currentNodeId()) .field("relocating_node", relocatingNodeId()) .field("shard", shardId().id()) - .field("index", shardId().index().name()) - .field("restore_source"); + .field("index", shardId().index().name()); if (restoreSource() != null) { + builder.field("restore_source"); restoreSource().toXContent(builder, params); - } else { - builder.nullValue(); } return builder.endObject(); }