mirror of https://github.com/WerWolv/ImHex.git
fix: Crash when searching for an empty string
This commit is contained in:
parent
0d3eaa5d86
commit
0c9eab70d5
|
@ -5,7 +5,6 @@
|
|||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/providers/buffered_reader.hpp>
|
||||
#include <hex/helpers/crypto.hpp>
|
||||
#include <hex/helpers/logger.hpp>
|
||||
|
||||
#include "math_evaluator.hpp"
|
||||
|
||||
|
@ -105,8 +104,10 @@ namespace hex::plugin::builtin {
|
|||
if (ImGui::BeginTabBar("##find_tabs")) {
|
||||
if (ImGui::BeginTabItem("hex.builtin.view.hex_editor.search.hex"_lang)) {
|
||||
if (ImGui::InputText("##input", this->m_input, ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_CharsHexadecimal)) {
|
||||
this->m_shouldSearch = true;
|
||||
this->m_backwards = false;
|
||||
if (!this->m_input.empty()) {
|
||||
this->m_shouldSearch = true;
|
||||
this->m_backwards = false;
|
||||
}
|
||||
}
|
||||
|
||||
this->drawButtons();
|
||||
|
@ -120,8 +121,10 @@ namespace hex::plugin::builtin {
|
|||
|
||||
if (ImGui::BeginTabItem("hex.builtin.view.hex_editor.search.string"_lang)) {
|
||||
if (ImGui::InputText("##input", this->m_input, ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_AutoSelectAll)) {
|
||||
this->m_shouldSearch = true;
|
||||
this->m_backwards = false;
|
||||
if (!this->m_input.empty()) {
|
||||
this->m_shouldSearch = true;
|
||||
this->m_backwards = false;
|
||||
}
|
||||
}
|
||||
|
||||
this->drawButtons();
|
||||
|
|
Loading…
Reference in New Issue