Commit efbf668d authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/applescript: add missing error handling

(cherry picked from commit 0dd9d856c522526594e0903336fc7b1db362b071)
parent 7b28d2e7
...@@ -42,31 +42,29 @@ ...@@ -42,31 +42,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