From a05687ea027f0b4990f1da6cfcfd0202b0840b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Mon, 23 Dec 2019 14:03:22 +0100 Subject: [PATCH] fix crash when calling runtime KM with nil map --- go/registry/api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/registry/api/api.go b/go/registry/api/api.go index 63996f1ba7e..d1943ce4836 100644 --- a/go/registry/api/api.go +++ b/go/registry/api/api.go @@ -925,7 +925,7 @@ func VerifyRegisterRuntimeArgs(logger *logging.Logger, sigRt *SignedRuntime, isG // VerifyRegisterComputeRuntimeArgs verifies ComputeRuntime-specific arguments for RegisterRuntime. func VerifyRegisterComputeRuntimeArgs(logger *logging.Logger, rt *Runtime, kmMap map[signature.PublicKey]*Runtime) error { - if kmMap[*rt.KeyManager] == nil { + if kmMap == nil && rt.KeyManager != nil || kmMap != nil && kmMap[*rt.KeyManager] == nil { logger.Error("RegisterRuntime: key manager ID not found as a valid key manager runtime", "runtime", rt, )