Commit f0dc54ba authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Mac OS X gui: Fix a crash when waking up from sleep.

parent 02c82b36
...@@ -237,15 +237,37 @@ ...@@ -237,15 +237,37 @@
{ {
id o_value = nil; id o_value = nil;
playlist_item_t *p_item; playlist_item_t *p_item;
if( item == nil || ![item isKindOfClass: [NSValue class]] ) return( @"error" ); /* For error handling */
static BOOL attempted_reload = NO;
if( item == nil || ![item isKindOfClass: [NSValue class]] )
{
/* Attempt to fix the error by asking for a data redisplay
* This might cause infinite loop, so add a small check */
if( !attempted_reload )
{
attempted_reload = YES;
[outlineView reloadData];
}
return @"error" ;
}
p_item = (playlist_item_t *)[item pointerValue]; p_item = (playlist_item_t *)[item pointerValue];
if( p_item == NULL ) if( !p_item || !p_item->p_input )
{ {
return( @"error"); /* Attempt to fix the error by asking for a data redisplay
* This might cause infinite loop, so add a small check */
if( !attempted_reload )
{
attempted_reload = YES;
[outlineView reloadData];
}
return @"error";
} }
attempted_reload = NO;
if( [[o_tc identifier] isEqualToString:@"1"] ) if( [[o_tc identifier] isEqualToString:@"1"] )
{ {
/* sanity check to prevent the NSString class from crashing */ /* sanity check to prevent the NSString class from crashing */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment