From 600491ddf3cada53a82a2d9c0fee09662a640033 Mon Sep 17 00:00:00 2001 From: fsociety Date: Sat, 28 Sep 2024 13:32:04 +0200 Subject: [PATCH] feat(config): check file existence before reading relay list from file --- config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 21e8747..59f9419 100644 --- a/config.go +++ b/config.go @@ -57,7 +57,9 @@ func getRelayListFromEnvOrFile(envKey, fileKey string) []string { filePath := getEnv(fileKey) if filePath != "" { - return getRelayListFromFile(filePath) + if _, err := os.Stat(filePath); err == nil { + return getRelayListFromFile(filePath) + } } if envValue != "" {