vinothchandar commented on code in PR #13737:
URL: https://github.com/apache/hudi/pull/13737#discussion_r2289200078


##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieTableMetadataUtil.java:
##########
@@ -2791,7 +2791,8 @@ public static Option<HoodieIndexVersion> 
getIndexVersionOption(String metadataPa
     if (!indexDefs.containsKey(metadataPartitionPath)) {
       return Option.empty();
     }
-    return Option.of(indexDefs.get(metadataPartitionPath).getVersion());
+    HoodieIndexVersion version = 
indexDefs.get(metadataPartitionPath).getVersion();
+    return version != null ? Option.of(version) : Option.empty();

Review Comment:
   @linliu-code @rahil-c 
   
   ```
   public static <T> Option<T> ofNullable(T value) {
       return null == value ? empty() : of(value);
     }
   ```
   
   does this already.. :) 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to