1
0
mirror of synced 2024-12-01 02:37:18 +01:00

fix: Crash when opening file picker

This commit is contained in:
WerWolv 2024-01-31 15:31:23 +01:00
parent 2e630a48f7
commit 4a9bac3cd5

View File

@ -204,7 +204,8 @@ namespace hex::fs {
bool openFileBrowser(DialogMode mode, const std::vector<ItemFilter> &validExtensions, const std::function<void(std::fs::path)> &callback, const std::string &defaultPath, bool multiple) {
// Turn the content of the ItemFilter objects into something NFD understands
std::vector<nfdfilteritem_t> validExtensionsNfd(validExtensions.size());
std::vector<nfdfilteritem_t> validExtensionsNfd;
validExtensionsNfd.reserve(validExtensions.size());
for (const auto &extension : validExtensions) {
validExtensionsNfd.emplace_back(nfdfilteritem_t{ extension.name.c_str(), extension.spec.c_str() });
}