rdsr commented on a change in pull request #1110:
URL: https://github.com/apache/iceberg/pull/1110#discussion_r440236751



##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -253,14 +253,21 @@ public String toString() {
     for (HistoryEntry logEntry : snapshotLog) {
       if (last != null) {
         Preconditions.checkArgument(
-            (logEntry.timestampMillis() - last.timestampMillis()) >= 0,
+            (logEntry.timestampMillis() - last.timestampMillis()) >= 
-ONE_MINUTE,
             "[BUG] Expected sorted snapshot log entries.");
       }
       last = logEntry;
     }
+    if (last != null) {

Review comment:
       The issue is that the argument - `last.timestampMillis()` will be 
evaluated eagerly and may result in NPE




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to