Fix crash in filesystem API.

Signed-off-by: Vyacheslav Chigrin <vyacheslav.chigrin@izba.dev>
This commit is contained in:
Vyacheslav Chigrin 2024-07-02 23:32:13 +03:00
parent bec703c300
commit d7606c4327
Signed by: vchigrin
GPG Key ID: 229C68CDE803410E

View File

@ -42,7 +42,10 @@ func (c *FSClient) Mkdir(ctx context.Context, paths ...string) error {
func (c *FSClient) ReadDir(ctx context.Context, dir string) ([]FileInfo, error) { func (c *FSClient) ReadDir(ctx context.Context, dir string) ([]FileInfo, error) {
res, err := c.client.ReadDir(ctx, &rpc.PathRequest{Path: dir}) res, err := c.client.ReadDir(ctx, &rpc.PathRequest{Path: dir})
return convertEntries(res.Entries), err if err != nil {
return nil, err
}
return convertEntries(res.Entries), nil
} }
func convertEntries(e []*rpc.FileInfo) []FileInfo { func convertEntries(e []*rpc.FileInfo) []FileInfo {