Skip to content

Commit c32262d

Browse files
authored
Avoid NPE if on SnapshotInfo if 'shallow' boolean not present (#18218)
Signed-off-by: Andrew Ross <andrross@amazon.com>
1 parent 560ac10 commit c32262d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3838
- Fix object field exists query ([#17843](https://github.com/opensearch-project/OpenSearch/pull/17843))
3939
- Use Bad Request status for InputCoercionEcception ([#18161](https://github.com/opensearch-project/OpenSearch/pull/18161))
4040
- Null check field names in QueryStringQueryBuilder ([#18194](https://github.com/opensearch-project/OpenSearch/pull/18194))
41+
- Avoid NPE if on SnapshotInfo if 'shallow' boolean not present ([#18187](https://github.com/opensearch-project/OpenSearch/issues/18187))
4142

4243
### Security
4344

server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4568,7 +4568,7 @@ public IndexShardSnapshot loadShardSnapshot(BlobContainer shardContainer, Snapsh
45684568
SnapshotId snapshotId = snapshotInfo.snapshotId();
45694569
if (snapshotInfo.getPinnedTimestamp() != 0) {
45704570
return () -> IndexShardSnapshotStatus.newDone(0L, 0L, 0, 0, 0, 0, "1");
4571-
} else if (snapshotInfo.isRemoteStoreIndexShallowCopyEnabled()) {
4571+
} else if (Boolean.TRUE.equals(snapshotInfo.isRemoteStoreIndexShallowCopyEnabled())) {
45724572
if (shardContainer.blobExists(REMOTE_STORE_SHARD_SHALLOW_COPY_SNAPSHOT_FORMAT.blobName(snapshotId.getUUID()))) {
45734573
return REMOTE_STORE_SHARD_SHALLOW_COPY_SNAPSHOT_FORMAT.read(
45744574
shardContainer,

0 commit comments

Comments
 (0)