From 5a033ec827a3de88367fbbf7a74573c21563c301 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Mon, 10 Mar 2025 20:52:18 +0000 Subject: [PATCH] Fix menu sorting FossilOrigin-Name: e1c921ff76644e0bda3e6d584cf5002034073979db5a6a239f3dcd20a910fb7d --- src/MenuItem.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/MenuItem.m b/src/MenuItem.m index 898c11e..b9bcba0 100644 --- a/src/MenuItem.m +++ b/src/MenuItem.m @@ -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;