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
......@@ -238,13 +238,35 @@
id o_value = nil;
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];
if( p_item == NULL )
if( !p_item || !p_item->p_input )
{
/* Attempt to fix the error by asking for a data redisplay
* This might cause infinite loop, so add a small check */
if( !attempted_reload )
{
return( @"error");
attempted_reload = YES;
[outlineView reloadData];
}
return @"error";
}
attempted_reload = NO;
if( [[o_tc identifier] isEqualToString:@"1"] )
{
......
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