diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h index 09d22acd01..a63f109eb0 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h @@ -21,8 +21,8 @@ public: RageFile f; CString data; - f.Open( "Data/splash.png" ); - f.Read( data ); + if( f.Open("Data/splash.png") ) + f.Read( data ); MakeNewCocoaWindow( data.data(), data.length() ); } ~LoadingWindow_Cocoa() { DisposeOfCocoaWindow(); } diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.m b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.m index 84b907f06d..2b010b9ef6 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.m +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.m @@ -7,8 +7,14 @@ static NSTextView *text; void MakeNewCocoaWindow( const void *data, unsigned length ) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSData *d = [NSData dataWithBytes:data length:length]; - NSImage *image = [[[NSImage alloc] initWithData:d] autorelease]; + NSImage *image = nil; + + if( length ) + { + NSData *d = [NSData dataWithBytes:data length:length]; + + image = [[[NSImage alloc] initWithData:d] autorelease]; + } if( !image ) image = [NSImage imageNamed:@"splash.png"];