present: Check for NULL to prevent crash

Closes: xorg/xserver#1275
Signed-off-by: Błażej Szczygieł <spaz16@wp.pl>
Tested-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit 22d58188)
3 jobs for backport-present-fix in 10 minutes and 49 seconds (queued for 2 seconds)