better proteciton against throwables with no message in assertions

This commit is contained in:
Boaz Leskes 2016-02-14 18:06:53 +01:00
parent 285c3bfa53
commit 7bb85e45c7
1 changed files with 2 additions and 1 deletions

View File

@ -1041,7 +1041,8 @@ public abstract class TransportReplicationAction<Request extends ReplicationRequ
} }
forceFinishAsFailed(new RetryOnPrimaryException(shardId, message, shardFailedError)); forceFinishAsFailed(new RetryOnPrimaryException(shardId, message, shardFailedError));
} else { } else {
assert shardFailedError.getMessage().contains("TransportService is closed") : assert shardFailedError.getMessage() != null &&
shardFailedError.getMessage().contains("TransportService is closed") :
shardFailedError; shardFailedError;
onReplicaFailure(nodeId, exp); onReplicaFailure(nodeId, exp);
} }