This is an automated email from the ASF dual-hosted git repository.

amoghj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new f4ddaea56b Core: Handle potential NPE in 
RESTSessionCatalog#newSessionCache (#10607)
f4ddaea56b is described below

commit f4ddaea56b7039ecf4e94273aa037e52da934de4
Author: Tai Le Manh <[email protected]>
AuthorDate: Tue Jul 2 07:23:30 2024 +0700

    Core: Handle potential NPE in RESTSessionCatalog#newSessionCache (#10607)
    
    Signed-off-by: Tai Le Manh <[email protected]>
---
 core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java 
b/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
index da40d4c3ae..11a6aa6f27 100644
--- a/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
+++ b/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
@@ -1049,7 +1049,12 @@ public class RESTSessionCatalog extends 
BaseViewSessionCatalog
     return Caffeine.newBuilder()
         .expireAfterAccess(Duration.ofMillis(expirationIntervalMs))
         .removalListener(
-            (RemovalListener<String, AuthSession>) (id, auth, cause) -> 
auth.stopRefreshing())
+            (RemovalListener<String, AuthSession>)
+                (id, auth, cause) -> {
+                  if (auth != null) {
+                    auth.stopRefreshing();
+                  }
+                })
         .build();
   }
 

Reply via email to