From c5696148f6dad739670f12b1d945666fa951d9da Mon Sep 17 00:00:00 2001 From: gitsang Date: Sat, 14 Jan 2023 12:36:32 +0000 Subject: [PATCH] fix: fix record zero len --- pkg/service/service.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/service/service.go b/pkg/service/service.go index 5844e03..80731b5 100644 --- a/pkg/service/service.go +++ b/pkg/service/service.go @@ -26,6 +26,11 @@ func UpdateDns() { log.Error("list record failed", zap.Error(err)) return } + if len(records) == 0 { + log.Error("record not found") + return + } + log.Info("describe domain records", zap.Reflect("records", records)) for _, ddns := range config.Cfg.DDNSs { if !ddns.Enable {