From 49e4a2d9ef6b156a0074a4052ed59914a4cd67c7 Mon Sep 17 00:00:00 2001 From: Davor Kapsa Date: Wed, 9 Oct 2019 15:55:07 +0200 Subject: [PATCH] Add error check --- common/powershell/hyperv/hyperv.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/powershell/hyperv/hyperv.go b/common/powershell/hyperv/hyperv.go index dc5d455c8..ecfb40ec2 100644 --- a/common/powershell/hyperv/hyperv.go +++ b/common/powershell/hyperv/hyperv.go @@ -283,6 +283,9 @@ Hyper-V\New-VM -Name "{{ .VMName }}" -Path "{{ .Path }}" -MemoryStartupBytes {{ } final := regex.ReplaceAllString(b.String(), "") regex, err = regexp.Compile("\n\n") + if err != nil { + return "", err + } final = regex.ReplaceAllString(final, "\n") return final, nil