Changeset 1154 for branches

Show
Ignore:
Timestamp:
02/21/10 21:16:05 (2 years ago)
Author:
gbooker
Message:

checking the value will return 0 even if the object is nil. We want this routine to distinguish between 0 and nil, so first check if the NSNumber is nil then its value.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/PlayerFramework/SapphireFrappliance/MetaData/SapphireMObjects/SapphireMovieTranslation.m

    r734 r1154  
    4545- (SapphireMoviePoster *)selectedPoster 
    4646{ 
     47        NSNumber *index = self.selectedPosterIndex; 
     48        if(index == nil) 
     49                return nil; 
     50         
    4751        NSArray *allPosters = [self.postersSet allObjects]; 
    48         NSPredicate *indexSearch = [NSPredicate predicateWithFormat:@"index = %d", self.selectedPosterIndexValue]; 
     52        NSPredicate *indexSearch = [NSPredicate predicateWithFormat:@"index = %d", [index intValue]]; 
    4953        allPosters = [allPosters filteredArrayUsingPredicate:indexSearch]; 
    5054        if(![allPosters count])