bugfix: Crash on trying to start a non-existant action from the API

This commit is contained in:
jamesread 2024-10-01 21:19:17 +01:00
parent 8258a758d2
commit 9723a38ca1
1 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,10 @@ func (api *oliveTinAPI) StartAction(ctx ctx.Context, req *pb.StartActionRequest)
pair := api.executor.MapActionIdToBinding[req.ActionId] pair := api.executor.MapActionIdToBinding[req.ActionId]
api.executor.MapActionIdToBindingLock.RUnlock() api.executor.MapActionIdToBindingLock.RUnlock()
if pair == nil || pair.Action == nil {
return nil, errors.New("Action not found")
}
execReq := executor.ExecutionRequest{ execReq := executor.ExecutionRequest{
Action: pair.Action, Action: pair.Action,
EntityPrefix: pair.EntityPrefix, EntityPrefix: pair.EntityPrefix,