compositor: fix possible dereference of NULL pointer