mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 06:15:38 +00:00
CDImageM3u: Fix crash when error pointer is null
This commit is contained in:
parent
6e189f4fd0
commit
69fb8de644
|
@ -53,15 +53,16 @@ bool CDImageM3u::Open(const char* path, Common::Error* error)
|
||||||
if (!fp)
|
if (!fp)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::optional<std::string> cue_file(FileSystem::ReadFileToString(fp));
|
std::optional<std::string> m3u_file(FileSystem::ReadFileToString(fp));
|
||||||
std::fclose(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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::istringstream ifs(cue_file.value());
|
std::istringstream ifs(m3u_file.value());
|
||||||
m_filename = path;
|
m_filename = path;
|
||||||
|
|
||||||
std::vector<std::string> entries;
|
std::vector<std::string> entries;
|
||||||
|
|
Loading…
Reference in a new issue