Skip to content

Commit 50e692f

Browse files
authored
Avoid NPE if on SnapshotInfo if 'shallow' boolean not present (#18218) (#18223)
(cherry picked from commit c32262d) Signed-off-by: Andrew Ross <[email protected]>
1 parent f4cc251 commit 50e692f

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
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1515

1616
### Fixed
1717
- Use Bad Request status for InputCoercionException ([#18161](https://github.com/opensearch-project/OpenSearch/pull/18161))
18+
- Avoid NPE if on SnapshotInfo if 'shallow' boolean not present ([#18187](https://github.com/opensearch-project/OpenSearch/issues/18187))
1819
- Null check field names in QueryStringQueryBuilder ([#18194](https://github.com/opensearch-project/OpenSearch/pull/18194))
1920

2021
### Security

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4711,7 +4711,7 @@ public IndexShardSnapshot loadShardSnapshot(BlobContainer shardContainer, Snapsh
47114711
SnapshotId snapshotId = snapshotInfo.snapshotId();
47124712
if (snapshotInfo.getPinnedTimestamp() != 0) {
47134713
return () -> IndexShardSnapshotStatus.newDone(0L, 0L, 0, 0, 0, 0, "1");
4714-
} else if (snapshotInfo.isRemoteStoreIndexShallowCopyEnabled()) {
4714+
} else if (Boolean.TRUE.equals(snapshotInfo.isRemoteStoreIndexShallowCopyEnabled())) {
47154715
if (shardContainer.blobExists(REMOTE_STORE_SHARD_SHALLOW_COPY_SNAPSHOT_FORMAT.blobName(snapshotId.getUUID()))) {
47164716
return REMOTE_STORE_SHARD_SHALLOW_COPY_SNAPSHOT_FORMAT.read(
47174717
shardContainer,

0 commit comments

Comments
 (0)