summaryrefslogtreecommitdiff
path: root/src/PlaylistFile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/PlaylistFile.cxx')
-rw-r--r--src/PlaylistFile.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index 4de73df30..1ae65eb3f 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -143,11 +143,13 @@ LoadPlaylistFileInfo(PlaylistInfo &info,
return false;
const auto name = AllocatedPath::FromFS(name_fs_str, name_fs_end);
- std::string name_utf8 = name.ToUTF8();
- if (name_utf8.empty())
+
+ try {
+ info.name = name.ToUTF8Throw();
+ } catch (...) {
return false;
+ }
- info.name = std::move(name_utf8);
info.mtime = fi.GetModificationTime();
return true;
}