feat(config): check file existence before reading relay list from file

This commit is contained in:
fsociety
2024-09-28 13:32:04 +02:00
parent 9ca7b57144
commit 600491ddf3

View File

@@ -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 != "" {