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;