mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
Fix segfault when opening recent file with pattern sync; Don't show p… (#2448)
…attern selection popup when pattern is already open This PR does two things. Most importantly, it fixes a segfault that can be caused by opening a recent file with pattern sync enabled. Secondly, it makes it so that the pattern selection popup does not appear if you already have text in the pattern editor for a given provider (due to CLI args, a project file, pattern sync, etc.). If you open a file normally, that text field is empty and the popup will appear so you can select a pre-made pattern like usual.
This commit is contained in:
@@ -40,8 +40,12 @@ namespace hex::plugin::builtin {
|
||||
return &m_editorRuntime;
|
||||
}
|
||||
|
||||
ui::TextEditor &getTextEditor() {
|
||||
return m_textEditor;
|
||||
ui::TextEditor *getTextEditor() {
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
if (provider == nullptr)
|
||||
return nullptr;
|
||||
|
||||
return &m_textEditor.get(provider);
|
||||
}
|
||||
|
||||
bool getChangesWereParsed() const {
|
||||
|
||||
Reference in New Issue
Block a user