Changeset 662

Show
Ignore:
Timestamp:
09/19/08 09:28:50 (4 months ago)
Author:
gbooker
Message:

Patch by Stephan to error check framework loading.
Fixes #231

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SapphireCompatibilityClasses/SapphireFrontRowCompat.h

    r631 r662  
    383383                NSString *compatPath = [frameworkPath stringByAppendingPathComponent:@"SapphireCompatClasses.framework"]; 
    384384                NSBundle *compat = [NSBundle bundleWithPath:compatPath]; 
    385                 [compat load]; 
     385                if( ![compat load]){  
     386                        @throw [NSException exceptionWithName:@"FileNotFoundException" reason:[NSString stringWithFormat:@"SapphireCompatClasses could not be loaded from path %@", compatPath] userInfo:nil]; 
     387                } 
    386388                if([SapphireFrontRowCompat usingFrontRow]) 
    387389                { 
    388390                        compatPath = [frameworkPath stringByAppendingPathComponent:@"SapphireLeopardCompatClasses.framework"]; 
    389391                        compat = [NSBundle bundleWithPath:compatPath]; 
    390                         [compat load]; 
     392                        if( ![compat load]){  
     393                                @throw [NSException exceptionWithName:@"FileNotFoundException" reason:[NSString stringWithFormat:@"SapphireLeopardCompatClasses could not be loaded from path %@", compatPath] userInfo:nil]; 
     394                        } 
    391395                } 
    392     // ATV2 
    393     if(NSClassFromString(@"BRMetadataPreviewController") == nil) 
    394     { 
    395       compatPath = [frameworkPath stringByAppendingPathComponent:@"SapphireTakeTwoCompatClasses.framework"]; 
    396       compat = [NSBundle bundleWithPath:compatPath]; 
    397       [compat load]; 
    398     } 
     396                // ATV2 
     397                if(NSClassFromString(@"BRMetadataPreviewController") == nil) 
     398                { 
     399                        compatPath = [frameworkPath stringByAppendingPathComponent:@"SapphireTakeTwoCompatClasses.framework"]; 
     400                        compat = [NSBundle bundleWithPath:compatPath]; 
     401                        if( ![compat load]){  
     402                                @throw [NSException exceptionWithName:@"FileNotFoundException" reason:[NSString stringWithFormat:@"SapphireTakeTwoCompatClasses could not be loaded from path %@", compatPath] userInfo:nil]; 
     403                        } 
     404                } 
    399405        }        
    400406}