shithub: hugo

Download patch

ref: d7798906d8e152a5d33f76ed0362628da8dd2c35
parent: 305ce1c9ec746d3b8f6c9306b7014bfd621478a5
author: Sam Smith <sams96@mail.com>
date: Sun Mar 1 17:00:28 EST 2020

tpl: Change error message on missing resource

Fixes #6942

--- a/tpl/resources/resources.go
+++ b/tpl/resources/resources.go
@@ -299,6 +299,9 @@
 
 	r, ok := args[1].(resources.ResourceTransformer)
 	if !ok {
+		if _, ok := args[1].(map[string]interface{}); !ok {
+			return nil, nil, fmt.Errorf("no Resource provided in transformation")
+		}
 		return nil, nil, fmt.Errorf("type %T not supported in Resource transformations", args[0])
 	}