diff --git a/src/common/cd_image_m3u.cpp b/src/common/cd_image_m3u.cpp index c64ad04db..9e0afbbb8 100644 --- a/src/common/cd_image_m3u.cpp +++ b/src/common/cd_image_m3u.cpp @@ -53,15 +53,16 @@ bool CDImageM3u::Open(const char* path, Common::Error* error) if (!fp) return false; - std::optional cue_file(FileSystem::ReadFileToString(fp)); + std::optional m3u_file(FileSystem::ReadFileToString(fp)); std::fclose(fp); - if (!cue_file.has_value() || cue_file->empty()) + if (!m3u_file.has_value() || m3u_file->empty()) { - error->SetMessage("Failed to read cue sheet"); + if (error) + error->SetMessage("Failed to read M3u file"); return false; } - std::istringstream ifs(cue_file.value()); + std::istringstream ifs(m3u_file.value()); m_filename = path; std::vector entries;