hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 66da1b7b2f8a8bd26ed4a50a54f64489f116f484
parent 5a9ecb82a39886a7241ec656fc980f20c1b8dd1c
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Mon, 13 Jun 2022 16:33:41 +0200

resources: Panic on Copy of Resource with .Err

Fixes #10006

Diffstat:
Mresources/resource.go | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/resources/resource.go b/resources/resource.go
@@ -128,6 +128,9 @@ type resourceCopier interface {
 
 // Copy copies r to the targetPath given.
 func Copy(r resource.Resource, targetPath string) resource.Resource {
+	if r.Err() != nil {
+		panic(fmt.Sprintf("Resource has an .Err: %s", r.Err()))
+	}
 	return r.(resourceCopier).cloneTo(targetPath)
 }