Skip to content

Commit 5054609

Browse files
committed
fix NULL handle close via jni
1 parent baf3ec7 commit 5054609

File tree

1 file changed

+3
-1
lines changed
  • graalpython/com.oracle.graal.python.jni/src

1 file changed

+3
-1
lines changed

graalpython/com.oracle.graal.python.jni/src/hpy_jni.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ static HPy augment_LongFromLong(HPyContext *ctx, long l) {
322322

323323
static void augment_Close(HPyContext *ctx, HPy h) {
324324
uint64_t bits = toBits(h);
325-
if (isBoxedHandle(bits)) {
325+
if (!bits) {
326+
return;
327+
} else if (isBoxedHandle(bits)) {
326328
return original_Close(ctx, h);
327329
}
328330
}

0 commit comments

Comments
 (0)