Changeset 7518


Ignore:
Timestamp:
Dec 26, 2008, 9:28:59 PM (12 years ago)
Author:
livings124
Message:

#1633 embed predicate evaluation in a @try

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/GroupsController.m

    r7515 r7518  
    230230                return nil;
    231231       
    232         return  [[fGroups objectAtIndex: orderIndex] objectForKey: @"AutoGroupRules"];
     232        return [[fGroups objectAtIndex: orderIndex] objectForKey: @"AutoGroupRules"];
    233233}
    234234
     
    430430        return NO;
    431431       
    432         NSPredicate * predicate = [self autoAssignRulesForIndex: index];
    433         return [predicate evaluateWithObject: torrent];
     432    NSPredicate * predicate = [self autoAssignRulesForIndex: index];
     433    BOOL eval = NO;
     434    @try
     435    {
     436        eval = [predicate evaluateWithObject:torrent];
     437    }
     438    @catch (NSException * exception)
     439    {
     440        NSLog(@"Error when evaluating predicate (%@) - %@", predicate, exception);
     441    }
     442    @finally
     443    {
     444        return eval;
     445    }
    434446}
    435447
Note: See TracChangeset for help on using the changeset viewer.