summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/FileMonitor.cpp
diff options
context:
space:
mode:
authorRyan Houdek <ryan.houdek@codethink.co.uk>2014-03-23 22:29:30 -0500
committerRyan Houdek <ryan.houdek@codethink.co.uk>2014-03-23 22:29:30 -0500
commit5310d6d2ea0233f745aa6fc9884930f7d30d4fee (patch)
treea7db4eb6db0124e9ba7321ecf0abf49d5ffd7f99 /Source/Core/DiscIO/FileMonitor.cpp
parent9849129b5d3fef5caa308c5ee1adebc2e07cc39d (diff)
Fix a crash that got recently introduced.
When CFileSystemGCWii::GetFileName can't find a valid filename it would return nullptr. nullptr as a std::string throws an assert within the std lib. So return an empty string and check if it is empty or not
Diffstat (limited to 'Source/Core/DiscIO/FileMonitor.cpp')
-rw-r--r--Source/Core/DiscIO/FileMonitor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/FileMonitor.cpp b/Source/Core/DiscIO/FileMonitor.cpp
index d99bd14cd8..4743e7c1af 100644
--- a/Source/Core/DiscIO/FileMonitor.cpp
+++ b/Source/Core/DiscIO/FileMonitor.cpp
@@ -143,6 +143,9 @@ void FindFilename(u64 offset)
}
const std::string filename = pFileSystem->GetFileName(offset);
+
+ if (filename.empty())
+ return;
CheckFile(filename, pFileSystem->GetFileSize(filename));
}