Skip to content

Commit 2885f74

Browse files
committed
fix possible NPE
1 parent 4dfa0eb commit 2885f74

File tree

1 file changed

+3
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime

1 file changed

+3
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/AsyncHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ void registerAction(Supplier<AsyncAction> actionSupplier) {
243243
void activateGIL() {
244244
CompilerAsserts.neverPartOfCompilation();
245245
final PythonContext ctx = context.get();
246+
if (ctx == null) {
247+
return;
248+
}
246249
final Env env = ctx.getEnv();
247250
final AtomicBoolean gilReleaseRequested = new AtomicBoolean(false);
248251
executorService.scheduleWithFixedDelay(() -> {

0 commit comments

Comments
 (0)