1
0
mirror of synced 2024-11-28 09:30:51 +01:00

fix: Potential crash when preprocessing invalid pattern file when loading a file

This commit is contained in:
WerWolv 2023-09-03 15:49:27 +02:00
parent 26f4aa0d9f
commit 971c8739ca

View File

@ -790,7 +790,11 @@ namespace hex::plugin::builtin {
if (!file.isValid())
continue;
runtime.getInternals().preprocessor->preprocess(runtime, file.readString());
try {
runtime.getInternals().preprocessor->preprocess(runtime, file.readString());
} catch (pl::core::err::PreprocessorError::Exception &e) {
log::warn("Failed to preprocess file {} during MIME analysis: {}", entry.path().string(), e.what());
}
if (foundCorrectType)
this->m_possiblePatternFiles.get(provider).push_back(entry.path());