fix: fix NullPointerException

fix NullPointerException in ContractStatusRecorder.killContract when killing a nonexistent contract process
This commit is contained in:
Frank.R.Wu 2021-12-12 17:12:49 +08:00
parent f59775da3f
commit c3f1407b6f

View File

@ -229,7 +229,9 @@ public class ContractStatusRecorder extends StatusRecorder<ContractMeta> {
ContractManager.instance.invokeContractSuicide(client); ContractManager.instance.invokeContractSuicide(client);
ContractManager.cPort.updateDb(client.port, false); ContractManager.cPort.updateDb(client.port, false);
} }
meta.contractExecutor.close(); if (null != meta.contractExecutor) {
meta.contractExecutor.close();
}
id2ContractClient.remove(meta.id); id2ContractClient.remove(meta.id);
runningProcess.remove(meta); runningProcess.remove(meta);
return "success"; return "success";