From 9963e18a8aa13ca937e54ee7b06737bc0deddfea Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Tue, 18 Nov 2025 13:28:03 +0000 Subject: [PATCH] fix(storage): do not write updated servers to file if file path is empty --- internal/storage/flush.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/storage/flush.go b/internal/storage/flush.go index 8ffcfd2f..3cb3b259 100644 --- a/internal/storage/flush.go +++ b/internal/storage/flush.go @@ -21,6 +21,9 @@ func (s *Storage) FlushToFile(path string) error { // flushToFile flushes the merged servers data to the file // specified by path, as indented JSON. It is not thread-safe. func (s *Storage) flushToFile(path string) error { + if path == "" { + return nil // no file to write to + } const permission = 0o644 dirPath := filepath.Dir(path) if err := os.MkdirAll(dirPath, permission); err != nil {