From 54610cdbb4467eb5bf5465992ac0df146879a90d Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Wed, 15 Jul 2026 13:48:46 +0200 Subject: [PATCH] fix #93 crash index template, check nil ptr --- pkg/es/index_template.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/es/index_template.go b/pkg/es/index_template.go index f67ebc0..1eaed07 100644 --- a/pkg/es/index_template.go +++ b/pkg/es/index_template.go @@ -51,7 +51,11 @@ func IndexTemplateList(conf *cfg.Config) error { return fmt.Errorf("failed to unmarshal meta json data: %w", err) } - table.Entries[idx] = []any{tpl.Name, desc, tpl.IndexTemplate.Priority} + var prio int64 + if tpl.IndexTemplate.Priority != nil { + prio = *tpl.IndexTemplate.Priority + } + table.Entries[idx] = []any{tpl.Name, desc, prio} } table.Sort()