Commit 0dd9d856 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/applescript: add missing error handling

parent 0d86a46b
...@@ -43,31 +43,29 @@ ...@@ -43,31 +43,29 @@
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Get( p_intf ); playlist_t * p_playlist = pl_Get( p_intf );
if( p_playlist == NULL )
{
return nil;
}
if ( o_urlString ) if ( o_urlString )
{ {
NSURL * o_url; NSURL * o_url;
input_item_t *p_input; input_item_t *p_input;
int returnValue;
p_input = input_item_New( [o_urlString fileSystemRepresentation], p_input = input_item_New( [o_urlString fileSystemRepresentation],
[[[NSFileManager defaultManager] [[[NSFileManager defaultManager]
displayNameAtPath: o_urlString] UTF8String] ); displayNameAtPath: o_urlString] UTF8String] );
/* FIXME: playlist_AddInput() can fail */ if (!p_input)
playlist_AddInput( p_playlist, p_input, PLAYLIST_INSERT, return nil;
PLAYLIST_END, true, pl_Unlocked );
returnValue = playlist_AddInput( p_playlist, p_input, PLAYLIST_INSERT,
PLAYLIST_END, true, pl_Unlocked );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
if (returnValue != VLC_SUCCESS)
return nil;
o_url = [NSURL fileURLWithPath: o_urlString]; o_url = [NSURL fileURLWithPath: o_urlString];
if( o_url != nil ) if( o_url != nil )
{ [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: o_url];
[[NSDocumentController sharedDocumentController]
noteNewRecentDocumentURL: o_url];
}
} }
} }
return nil; return nil;
......
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