configfile: return specific error on empty input
Report the actual problem instead of a generic "unexpected end of JSON input". https://github.com/rfjakob/gocryptfs/issues/258
This commit is contained in:
parent
22906cc5fa
commit
21eaa8f164
@ -133,6 +133,9 @@ func Load(filename string, password []byte) ([]byte, *ConfFile, error) {
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if len(js) == 0 {
|
||||
return nil, nil, fmt.Errorf("Config file is empty")
|
||||
}
|
||||
|
||||
// Unmarshal
|
||||
err = json.Unmarshal(js, &cf)
|
||||
|
Loading…
Reference in New Issue
Block a user