[ecore_x] Fix to handle paste null data case.
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 20 Jan 2014 13:15:33 +0000 (22:15 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 20 Jan 2014 13:15:33 +0000 (22:15 +0900)
Summary: Do nothing when null data is pasted.

Reviewers: Hermet, raster

Reviewed By: raster

CC: seoz, raster, cedric
Differential Revision: https://phab.enlightenment.org/D473

src/lib/ecore_x/xcb/ecore_xcb_events.c
src/lib/ecore_x/xlib/ecore_x_events.c

index adee7ce..45142cf 100644 (file)
@@ -1354,9 +1354,12 @@ _ecore_xcb_event_handle_selection_notify(xcb_generic_event_t *event)
           }
      }
    else
-     format = ecore_x_window_prop_property_get(ev->requestor, ev->property,
-                                               XCB_GET_PROPERTY_TYPE_ANY, 8,
-                                               &data, &num);
+     {
+        format = ecore_x_window_prop_property_get(ev->requestor, ev->property,
+                                                  XCB_GET_PROPERTY_TYPE_ANY, 8,
+                                                  &data, &num);
+        if (!format) return;
+     }
 
    e = calloc(1, sizeof(Ecore_X_Event_Selection_Notify));
    if (!e) return;
index 467cbcd..bbb3534 100644 (file)
@@ -1426,10 +1426,13 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
           }
      }
    else
-     format = ecore_x_window_prop_property_get(xevent->xselection.requestor,
-                                               xevent->xselection.property,
-                                               AnyPropertyType, 8, &data,
-                                               &num_ret);
+     {
+        format = ecore_x_window_prop_property_get(xevent->xselection.requestor,
+                                                  xevent->xselection.property,
+                                                  AnyPropertyType, 8, &data,
+                                                  &num_ret);
+        if (!format) return;
+     }
 
    e = calloc(1, sizeof(Ecore_X_Event_Selection_Notify));
    if (!e)