Fix menu sorting

FossilOrigin-Name: e1c921ff76644e0bda3e6d584cf5002034073979db5a6a239f3dcd20a910fb7d
This commit is contained in:
Jonathan Schleifer 2025-03-10 20:52:18 +00:00
parent c49ae6bbe5
commit 5a033ec827

View file

@ -18,8 +18,17 @@
if (![otherObject isKindOfClass:MenuItem.class])
@throw [OFInvalidArgumentException exception];
int x = (int)_text.longLongValue;
int y = (int)otherItem.text.longLongValue;
int x, y;
@try {
x = (int)_text.longLongValue;
} @catch (OFInvalidFormatException *e) {
x = 0;
}
@try {
y = (int)otherItem.text.longLongValue;
} @catch (OFInvalidFormatException *e) {
y = 0;
}
if (x > y)
return OFOrderedAscending;