fixed empty config file

This commit is contained in:
Timon Ringwald 2022-08-17 22:40:39 +02:00
parent 252d0b7278
commit 115871aeb7

View File

@ -2,6 +2,8 @@ package main
import ( import (
"encoding/json" "encoding/json"
"errors"
"io"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
@ -41,6 +43,9 @@ func LoadConfig() error {
cfg := &Config{} cfg := &Config{}
if err := json.NewDecoder(file).Decode(cfg); err != nil { if err := json.NewDecoder(file).Decode(cfg); err != nil {
if errors.Is(err, io.EOF) {
return nil
}
return err return err
} }