Fixing an issue where we occasionally get a no implicit conversion of nil into string error.

This fix handles situations where a response might be nil.