diff options
author | Max Kellermann <max@musicpd.org> | 2018-07-18 16:30:46 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-07-18 16:51:29 +0200 |
commit | 32290d5eb848a22e7b16b29e4be7651c002ca14f (patch) | |
tree | 81d24355051c4951af994601288d668bceb42d2d /src/storage/plugins/LocalStorage.cxx | |
parent | f87265a4d52f140d6f156868b2e92efd1951c07e (diff) |
fs/Path: add method ToUTF8Throw()
Diffstat (limited to 'src/storage/plugins/LocalStorage.cxx')
-rw-r--r-- | src/storage/plugins/LocalStorage.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/storage/plugins/LocalStorage.cxx b/src/storage/plugins/LocalStorage.cxx index 78e5df2e4..92c6c99ff 100644 --- a/src/storage/plugins/LocalStorage.cxx +++ b/src/storage/plugins/LocalStorage.cxx @@ -51,7 +51,7 @@ class LocalStorage final : public Storage { public: explicit LocalStorage(Path _base_fs) - :base_fs(_base_fs), base_utf8(base_fs.ToUTF8()) { + :base_fs(_base_fs), base_utf8(base_fs.ToUTF8Throw()) { assert(!base_fs.IsNull()); assert(!base_utf8.empty()); } @@ -162,11 +162,11 @@ LocalDirectoryReader::Read() noexcept if (SkipNameFS(name_fs.c_str())) continue; - name_utf8 = name_fs.ToUTF8(); - if (name_utf8.empty()) - continue; - - return name_utf8.c_str(); + try { + name_utf8 = name_fs.ToUTF8Throw(); + return name_utf8.c_str(); + } catch (...) { + } } return nullptr; |