summaryrefslogtreecommitdiff
path: root/src/lib/ecore_cocoa
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2018-06-21 14:58:25 +0100
committerAlastair Poole <netstar@gmail.com>2018-06-21 14:58:25 +0100
commit11b291aabefd09230ca9e24bd87d9118e6a7bc91 (patch)
treeef3d90965f7846adfd29f5562aa04e8730f2162d /src/lib/ecore_cocoa
parenta939b57c7b4da5171d92de93f1d837bcef842765 (diff)
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.
Diffstat (limited to 'src/lib/ecore_cocoa')
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_cnp.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
index da2db90aa0..03dcb22771 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
@@ -24,7 +24,8 @@ ecore_cocoa_clipboard_set(const void *data,
24 str = [[NSString alloc] initWithBytes: data 24 str = [[NSString alloc] initWithBytes: data
25 length: size 25 length: size
26 encoding: NSUTF8StringEncoding]; 26 encoding: NSUTF8StringEncoding];
27 [objects addObject: str]; 27 if (str)
28 [objects addObject: str];
28 } 29 }
29 if (type & ECORE_COCOA_CNP_TYPE_MARKUP) 30 if (type & ECORE_COCOA_CNP_TYPE_MARKUP)
30 { 31 {
@@ -35,7 +36,8 @@ ecore_cocoa_clipboard_set(const void *data,
35 length: strlen(utf8) // XXX strlen() ? 36 length: strlen(utf8) // XXX strlen() ?
36 encoding: NSUTF8StringEncoding]; 37 encoding: NSUTF8StringEncoding];
37 free(utf8); 38 free(utf8);
38 [objects addObject: str]; 39 if (str)
40 [objects addObject: str];
39 } 41 }
40 if (type & ECORE_COCOA_CNP_TYPE_IMAGE) 42 if (type & ECORE_COCOA_CNP_TYPE_IMAGE)
41 { 43 {