msgstore_fs: fix ListTargets error on missing log dir
Initially, before connecting to the network, the log dir will be empty. Return an empty list of chat history targets in this case.
This commit is contained in:
parent
6e8b6fa153
commit
8a0400c5cc
@ -480,7 +480,9 @@ func (ms *fsMessageStore) ListTargets(network *network, start, end time.Time, li
|
|||||||
end = end.In(time.Local)
|
end = end.In(time.Local)
|
||||||
rootPath := filepath.Join(ms.root, escapeFilename(network.GetName()))
|
rootPath := filepath.Join(ms.root, escapeFilename(network.GetName()))
|
||||||
root, err := os.Open(rootPath)
|
root, err := os.Open(rootPath)
|
||||||
if err != nil {
|
if os.IsNotExist(err) {
|
||||||
|
return nil, nil
|
||||||
|
} else if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user