Skip to content

Commit 2e8bbed

Browse files
Fix related to misuse of System.nanoTime
1 parent 6c0baaf commit 2e8bbed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/providers/MostRecentProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public MostRecentProvider(final ProviderStore keystore, final String materialNam
5353
@Override
5454
public EncryptionMaterials getEncryptionMaterials(EncryptionContext context) {
5555
State s = state.get();
56-
if (System.nanoTime() - s.lastUpdated <= ttlInNanos) {
56+
if (s.provider != null && System.nanoTime() - s.lastUpdated <= ttlInNanos) {
5757
return s.provider.getEncryptionMaterials(context);
5858
}
5959
if (s.provider == null || System.nanoTime() - s.lastUpdated > ttlInNanos + TTL_GRACE_IN_NANO) {

0 commit comments

Comments
 (0)