# migrator: Avoid attempting to migrate empty content \(\#39771\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a9455eb947bce374a6b10974b4a119d255ec4061)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a9455eb947bce374a6b10974b4a119d255ec4061

Requested commit: a9455eb947bce374a6b10974b4a119d255ec4061

Commit: a9455eb947bce374a6b10974b4a119d255ec4061

Tree: 64b2c41c5a7d13ce17fd4ce720d5559ed87a3d39

Author: Dino

Committer: GitHub

## Message

```
migrator: Avoid attempting to migrate empty content (#39771)

This commit fixes an issue where opening zed using `--user-data-dir`
with an empty directory would cause the first run to display a "Failed
to migrate settings" error.

This was caused by the migrator attempting to migrate an empty string,
so if that's the case, we'll simply return `Ok(None)` and avoid
attempting to migrate anything at all.

Relates to #39400

Release Notes:

- N/A

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
```

## Parents

- [db3c186af0880a462b98cb5be366df0f4f1a1f03](https://git.cafe/gitcafe/zed/commit/db3c186af0880a462b98cb5be366df0f4f1a1f03?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a9455eb947bce374a6b10974b4a119d255ec4061?format=markdown)
