Skip to content

Commit 5224108

Browse files
authored
fix: check if handle has been initialized before closing (#1554)
* fix: check if handle has been initialized before closing * address comments
1 parent 382ac93 commit 5224108

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

common/src/main/java/org/apache/comet/parquet/NativeBatchReader.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,10 @@ public void close() throws IOException {
459459
importer = null;
460460
}
461461
nativeUtil.close();
462-
Native.closeRecordBatchReader(this.handle);
462+
if (this.handle > 0) {
463+
Native.closeRecordBatchReader(this.handle);
464+
this.handle = 0;
465+
}
463466
}
464467

465468
@SuppressWarnings("deprecation")

0 commit comments

Comments
 (0)