Validate if entries are not empty before using

Should fix saving problem in Baldur's Gate: Dark Alliance II at least
This commit is contained in:
Dima 2022-11-29 10:14:43 +03:00 committed by Billy Laws
parent 5f510d84d7
commit bbd34ae7e7

View File

@ -28,6 +28,7 @@ namespace skyline::service::fssrv {
auto outputEntries{request.outputBuf.at(0).cast<DirectoryEntry, std::dynamic_extent, true>()}; auto outputEntries{request.outputBuf.at(0).cast<DirectoryEntry, std::dynamic_extent, true>()};
size_t i{}; size_t i{};
if (!entries.empty())
for (; i < std::min(entries.size() - remainingReadCount, outputEntries.size()); i++) { for (; i < std::min(entries.size() - remainingReadCount, outputEntries.size()); i++) {
auto &entry{entries.at(i)}; auto &entry{entries.at(i)};