From 9f30164312af7ec925b7c9b64689aa830617b096 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 22 Aug 2023 12:09:53 -0400 Subject: [PATCH] Fixed filling OleError with error info. An allocated struct is needed to fill in its fields. --- internal/osutils/shortcut/shortcut_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/osutils/shortcut/shortcut_windows.go b/internal/osutils/shortcut/shortcut_windows.go index c778d79f64..7668d6c4f4 100644 --- a/internal/osutils/shortcut/shortcut_windows.go +++ b/internal/osutils/shortcut/shortcut_windows.go @@ -66,7 +66,7 @@ func (s *Shortcut) Enable() error { logging.Debug("Creating Shortcut: %s", filename) cs, err := oleutil.CallMethod(wshell, "CreateShortcut", filename) if err != nil { - var oleErr *ole.OleError + oleErr := &ole.OleError{} if errors.As(err, &oleErr) { return errs.Wrap(err, "oleutil CreateShortcut returned error: %s, parent error: %s", oleErr.Description(), oleErr.SubError()) }