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