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.

git-svn-id: file:///srv/svn/repo/suika/trunk@628 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This commit is contained in:
contact 2021-10-12 15:36:00 +00:00
parent 627f9f74a7
commit 75c7442d34

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
}