Checking if the camera is null before releasing the preview