Преглед изворни кода

Fix NPE in toString of FailedShard (#64770)

The concatenation took precedence over the null check, leading to an NPE
because `null` was passed to `ExceptionsHelper.stackTrace(failure))`.
Armin Braun пре 5 година
родитељ
комит
c53b0eac8a

+ 1 - 1
server/src/main/java/org/elasticsearch/cluster/routing/allocation/FailedShard.java

@@ -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)) + "]";
     }
 
     /**