diff --git a/hcloud/action_waiter.go b/hcloud/action_waiter.go index b14815e7..18f32c80 100644 --- a/hcloud/action_waiter.go +++ b/hcloud/action_waiter.go @@ -21,6 +21,9 @@ var _ ActionWaiter = (*ActionClient)(nil) // // The handleUpdate callback is called every time an action is updated. func (c *ActionClient) WaitForFunc(ctx context.Context, handleUpdate func(update *Action) error, actions ...*Action) error { + // Filter out nil actions + actions = slices.DeleteFunc(actions, func(a *Action) bool { return a == nil }) + running := make(map[int]struct{}, len(actions)) for _, action := range actions { if action.Status == ActionStatusRunning {