camera: catch possible NULL pointer dereference