fix: Crash when sorting Value column

This commit is contained in:
WerWolv
2023-05-24 21:04:59 +02:00
parent 26eac61ddf
commit 320973c5ff

View File

@@ -864,9 +864,9 @@ namespace hex::plugin::builtin::ui {
return left->getSizeForSorting() > right->getSizeForSorting();
} else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("value")) {
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
return left->getValue() < right->getValue();
return left->getValue().toString(true) < right->getValue().toString(true);
else
return left->getValue() > right->getValue();
return left->getValue().toString(true) > right->getValue().toString(true);
} else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("type")) {
if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending)
return left->getTypeName() < right->getTypeName();