mirror of https://github.com/WerWolv/ImHex.git
fix: Crash when auto-load-patterns is being disabled
This commit is contained in:
parent
8ebbe6fb4e
commit
f349aafc37
|
@ -109,13 +109,12 @@ namespace hex::plugin::builtin {
|
|||
});
|
||||
|
||||
EventManager::subscribe<EventProviderOpened>(this, [this](prv::Provider *provider) {
|
||||
auto &patternLanguageData = ProviderExtraData::get(provider).patternLanguage;
|
||||
patternLanguageData.runtime = ContentRegistry::PatternLanguage::createDefaultRuntime(provider);
|
||||
|
||||
if (!this->m_autoLoadPatterns)
|
||||
return;
|
||||
|
||||
auto &patternLanguageData = ProviderExtraData::get(provider).patternLanguage;
|
||||
|
||||
patternLanguageData.runtime = ContentRegistry::PatternLanguage::createDefaultRuntime(provider);
|
||||
|
||||
// Copy over current pattern source code to the new provider
|
||||
if (!this->m_syncPatternSourceCode) {
|
||||
patternLanguageData.sourceCode = this->m_textEditor.GetText();
|
||||
|
|
Loading…
Reference in New Issue