: DSObjectPrivate(touch),
__p_ptr(touch),
__seat(seat),
- __compositor(seat->getCompositor()),
+ __compositor(seat ? (seat->getCompositor()) : nullptr),
__waylandSurface(nullptr),
__wlTouchResource(nullptr)
{
__waylandSurface = waylandSurface;
- if (!waylandSurface)
+ if (!waylandSurface || !waylandSurface->hasResource())
+ {
+ __wlTouchResource = nullptr;
+ DSLOG_INF("DSWaylandTouchPrivate", "wlTouchResource has been set to null.");
return;
+ }
struct ::wl_resource *surface = waylandSurface->getWlResource();
auto client = wl_resource_get_client(surface);