fix: Potential crashes when pasting with no clipboard content

This commit is contained in:
WerWolv
2022-10-06 09:35:18 +02:00
parent e0c35e0002
commit f039ea68d0
2 changed files with 9 additions and 4 deletions

View File

@@ -1222,6 +1222,8 @@ namespace hex::plugin::builtin {
auto provider = ImHexApi::Provider::get();
std::string clipboard = ImGui::GetClipboardText();
if (clipboard.empty())
return;
// Check for non-hex characters
bool isValidHexString = std::find_if(clipboard.begin(), clipboard.end(), [](char c) {