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)
5 jobs for present-crash-21.1-backport in 10 minutes and 34 seconds (queued for 5 seconds)