The concatenation took precedence over the null check, leading to an NPE because `null` was passed to `ExceptionsHelper.stackTrace(failure))`.
@@ -43,7 +43,7 @@ public class FailedShard {
@Override
public String toString() {
return "failed shard, shard " + routingEntry + ", message [" + message + "], markAsStale [" + markAsStale + "], failure ["
- + failure == null ? "null" : ExceptionsHelper.stackTrace(failure) + "]";
+ + (failure == null ? "null" : ExceptionsHelper.stackTrace(failure)) + "]";
}
/**