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:
Simon Ser 2021-10-12 17:34:22 +02:00
parent 6e8b6fa153
commit 8a0400c5cc

View File

@ -480,7 +480,9 @@ func (ms *fsMessageStore) ListTargets(network *network, start, end time.Time, li
end = end.In(time.Local)
rootPath := filepath.Join(ms.root, escapeFilename(network.GetName()))
root, err := os.Open(rootPath)
if err != nil {
if os.IsNotExist(err) {
return nil, nil
} else if err != nil {
return nil, err
}