Fix crash in filesystem API. #69

Merged
Elara6331 merged 1 commits from vchigrin/itd:fix-crash into master 2024-07-04 03:25:39 +00:00
Showing only changes of commit d7606c4327 - Show all commits

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) {
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
Elara6331 marked this conversation as resolved Outdated

Thanks for the PR! Can you please also change return convertEntries(res.Entries), err to return convertEntries(res.Entries), nil?

Thanks for the PR! Can you please also change `return convertEntries(res.Entries), err` to `return convertEntries(res.Entries), nil`?
}
func convertEntries(e []*rpc.FileInfo) []FileInfo {