Fix potential crash when processing response object