Skip to content

Commit 23e7c59

Browse files
Fix NPE on Stale Index in IndicesService (elastic#38891)
* Closes elastic#38845
1 parent 0a88e7f commit 23e7c59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/main/java/org/elasticsearch/indices/IndicesService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,9 @@ public IndexMetaData verifyIndexIsDeleted(final Index index, final ClusterState
882882
final IndexMetaData metaData;
883883
try {
884884
metaData = metaStateService.loadIndexState(index);
885+
if (metaData == null) {
886+
return null;
887+
}
885888
} catch (Exception e) {
886889
logger.warn(() -> new ParameterizedMessage("[{}] failed to load state file from a stale deleted index, " +
887890
"folders will be left on disk", index), e);

0 commit comments

Comments
 (0)