Change-Id: I8e62560f3fb7ebb6e828978d9d20b5c6d502b9b2
{
pid_t pid;
struct wl_client *client = NULL;
- struct ds_surface *surface = ds_xdg_surface_get_surface(view->xdg_surface);
+ struct ds_surface *surface;
+
+ surface = ds_xdg_surface_get_surface(view->xdg_surface);
+ if (!surface)
+ return;
+
+ client = wl_resource_get_client(ds_surface_get_wl_resource(surface));
+ if (!client)
+ return;
- if (surface)
- client = wl_resource_get_client(ds_surface_get_wl_resource(surface));
wl_client_get_credentials(client, &pid, NULL, NULL);
ds_inf("view pid(%u)", pid);