fix: check nil

This commit is contained in:
Kevin Franklin Kim
2025-03-17 11:39:06 +01:00
parent 82d5b597f5
commit 898f63a1ad
+1 -1
View File
@@ -7,7 +7,7 @@ import (
)
func TemplateType(template *tagmanager.CustomTemplate) string {
if template.GalleryReference.GalleryTemplateId != "" {
if template.GalleryReference != nil && template.GalleryReference.GalleryTemplateId != "" {
return fmt.Sprintf("cvt_%s", template.GalleryReference.GalleryTemplateId)
}
return fmt.Sprintf("cvt_%s_%s", template.ContainerId, template.TemplateId)