[RECOVERY] Fix potential NPE status reference must be not null to fail recovery

This commit is contained in:
Simon Willnauer 2014-11-05 22:42:20 +01:00
parent 687705364d
commit 275ae2d4da
1 changed files with 1 additions and 1 deletions

View File

@ -462,7 +462,7 @@ public class RecoveryTarget extends AbstractComponent {
@Override
public void onFailure(Throwable t) {
try (RecoveriesCollection.StatusRef statusRef = onGoingRecoveries.getStatus(recoveryId)) {
if (statusRef == null) {
if (statusRef != null) {
logger.error("unexpected error during recovery [{}], failing shard", t, recoveryId);
onGoingRecoveries.failRecovery(recoveryId,
new RecoveryFailedException(statusRef.status().state(), "unexpected error", t),