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 (
"encoding/json"
"errors"
"io"
"os"
"path/filepath"
"strings"
@ -41,6 +43,9 @@ func LoadConfig() error {
cfg := &Config{}
if err := json.NewDecoder(file).Decode(cfg); err != nil {
if errors.Is(err, io.EOF) {
return nil
}
return err
}