Skip to content

Commit 3f7c081

Browse files
committed
check for empty filepath
1 parent 44ca275 commit 3f7c081

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/config/config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -933,12 +933,12 @@ func values(headers []Header) []Header {
933933

934934
for _, header := range headers {
935935
value := header.Value
936-
if value == "" {
937-
filePath := header.FilePath
938-
939-
value, err = file.ReadFromFile(filePath)
936+
if value == "" && header.FilePath != "" {
937+
slog.Debug("Read value from file", "path", header.FilePath)
938+
value, err = file.ReadFromFile(header.FilePath)
940939
if err != nil {
941-
slog.Error("Unable to read value from file path", "error", err, "file_path", filePath)
940+
slog.Error("Unable to read value from file path",
941+
"error", err, "file_path", header.FilePath)
942942
}
943943
}
944944

0 commit comments

Comments
 (0)