Ensure response exists before using it

cc: @calvinfo