Fix undefined index error when response body is null