ecore_cocoa_cnp: Check for nil object before adding.

This is fixing a segfault. More work needs to be done in
efl_selection_manager.c. Current status is broken.
This commit is contained in:
Alastair Poole 2018-06-21 14:58:25 +01:00
parent a939b57c7b
commit 11b291aabe
1 changed files with 4 additions and 2 deletions

View File

@ -24,7 +24,8 @@ ecore_cocoa_clipboard_set(const void *data,
str = [[NSString alloc] initWithBytes: data
length: size
encoding: NSUTF8StringEncoding];
[objects addObject: str];
if (str)
[objects addObject: str];
}
if (type & ECORE_COCOA_CNP_TYPE_MARKUP)
{
@ -35,7 +36,8 @@ ecore_cocoa_clipboard_set(const void *data,
length: strlen(utf8) // XXX strlen() ?
encoding: NSUTF8StringEncoding];
free(utf8);
[objects addObject: str];
if (str)
[objects addObject: str];
}
if (type & ECORE_COCOA_CNP_TYPE_IMAGE)
{