From c3f1407b6fbc2b7e59b050c1e72c9c0a95c59f48 Mon Sep 17 00:00:00 2001 From: "Frank.R.Wu" Date: Sun, 12 Dec 2021 17:12:49 +0800 Subject: [PATCH] fix: fix NullPointerException fix NullPointerException in ContractStatusRecorder.killContract when killing a nonexistent contract process --- src/main/java/org/bdware/sc/ContractStatusRecorder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bdware/sc/ContractStatusRecorder.java b/src/main/java/org/bdware/sc/ContractStatusRecorder.java index 3a595f2..5f47f1c 100644 --- a/src/main/java/org/bdware/sc/ContractStatusRecorder.java +++ b/src/main/java/org/bdware/sc/ContractStatusRecorder.java @@ -229,7 +229,9 @@ public class ContractStatusRecorder extends StatusRecorder { ContractManager.instance.invokeContractSuicide(client); ContractManager.cPort.updateDb(client.port, false); } - meta.contractExecutor.close(); + if (null != meta.contractExecutor) { + meta.contractExecutor.close(); + } id2ContractClient.remove(meta.id); runningProcess.remove(meta); return "success";