From daeb78f5a0180f4d4af02f68d735f11c7ffa90eb Mon Sep 17 00:00:00 2001 From: Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> Date: Fri, 14 Jul 2023 20:07:15 +0000 Subject: [PATCH] feat: validate input is enum value --- proxmox/config_guest.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxmox/config_guest.go b/proxmox/config_guest.go index ffc183a2..db25050c 100644 --- a/proxmox/config_guest.go +++ b/proxmox/config_guest.go @@ -146,7 +146,11 @@ const ( // check if the guest has the specified feature. func GuestHasFeature(vmr *VmRef, client *Client, feature GuestFeature) (bool, error) { - err := client.CheckVmRef(vmr) + err := feature.Validate() + if err != nil { + return false, err + } + err = client.CheckVmRef(vmr) if err != nil { return false, err }