You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/05/06 23:38:01 UTC

[GitHub] [iceberg] kbendick commented on a diff in pull request #4702: Avoid possible NPE in Writer close

kbendick commented on code in PR #4702:
URL: https://github.com/apache/iceberg/pull/4702#discussion_r867266902


##########
core/src/main/java/org/apache/iceberg/ManifestWriter.java:
##########
@@ -178,8 +178,10 @@ public ManifestFile toManifestFile() {
 
   @Override
   public void close() throws IOException {
-    this.closed = true;
-    writer.close();
+    if (writer != null) {
+      writer.close();
+      this.closed = true;

Review Comment:
   Nit: This should probably still set `this.closed = true` even if the writer is null.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org