Commit 65974cea authored by Max Kellermann's avatar Max Kellermann

PlaylistFile: remove redundant existence check

parent 6caf53d1
......@@ -366,10 +366,6 @@ spl_append_uri(const char *utf8file,
static void
spl_rename_internal(Path from_path_fs, Path to_path_fs)
{
if (!FileExists(from_path_fs))
throw PlaylistError(PlaylistResult::NO_SUCH_LIST,
"No such playlist");
if (FileExists(to_path_fs))
throw PlaylistError(PlaylistResult::LIST_EXISTS,
"Playlist exists already");
......@@ -377,7 +373,7 @@ spl_rename_internal(Path from_path_fs, Path to_path_fs)
try {
RenameFile(from_path_fs, to_path_fs);
} catch (const std::system_error &e) {
if (IsPathNotFound(e))
if (IsFileNotFound(e))
throw PlaylistError(PlaylistResult::NO_SUCH_LIST,
"No such playlist");
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment