shell: Check more thoroughly for undefined surface resource
authorBryce Harrington <bryce@osg.samsung.com>
Thu, 24 Sep 2015 00:30:43 +0000 (17:30 -0700)
committerBryce Harrington <bryce@bryceharrington.org>
Thu, 4 Feb 2016 03:05:12 +0000 (19:05 -0800)
commit22b1f93432c775b6ed077c15a19e9e734a2806a5
tree3615b2f9ef1cc3ec0adf5eb6f9de0da9a5b88fd7
parent90c2789e8d83a5b090cf4b91a6770a93f08028a0
shell: Check more thoroughly for undefined surface resource

The surface can have an undefined resource in certain situations (such
as with xwayland).  So, since NULL is a valid state for this parameter,
and since the wl_resource_*, etc. calls require their parameters to be
non-NULL, make a practice of always checking the surface resource before
making wayland calls.

update v2:
  * Fix some c/p errors for pointer names
  * Drop null ptr check in add_popup_grab; probably redundant now

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
desktop-shell/shell.c