tree/container: fix null pointer dereferencing

This commit is contained in:
Chengyu Zheng 2018-09-10 11:54:23 +02:00
parent f7568e26e9
commit ee2c357ec2

View file

@ -303,6 +303,9 @@ static struct sway_container *floating_container_at(double lx, double ly,
struct sway_container *tiling_container_at(struct sway_node *parent, struct sway_container *tiling_container_at(struct sway_node *parent,
double lx, double ly, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy) { struct wlr_surface **surface, double *sx, double *sy) {
if (parent == NULL) {
return NULL;
}
if (node_is_view(parent)) { if (node_is_view(parent)) {
surface_at_view(parent->sway_container, lx, ly, surface, sx, sy); surface_at_view(parent->sway_container, lx, ly, surface, sx, sy);
return parent->sway_container; return parent->sway_container;