Skip to content

Commit 41f9662

Browse files
Guard against creating an empty directory path
Signed-off-by: Chris Cummer <chriscummer@me.com>
1 parent 804a304 commit 41f9662

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

til.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ func makeConfigDir() {
211211
Defeat(err)
212212
}
213213

214+
if cDir == "" {
215+
Defeat(errors.New(errConfigPathEmpty))
216+
}
217+
214218
if _, err := os.Stat(cDir); os.IsNotExist(err) {
215219
err := os.MkdirAll(cDir, os.ModePerm)
216220
if err != nil {

0 commit comments

Comments
 (0)