Skip to content

Commit

Permalink
Fix infinite loop in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Jan 10, 2025
1 parent 2caa892 commit a5bab39
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,23 @@ internal QueryStreamer(RunQueryRequest initialRequest, ApiCall<RunQueryRequest,

private static void ModifyRequest(RunQueryRequest request, RunQueryResponse response)
{
if (response.Query is null || response.Batch is null)
// Explain-only responses don't have batches, but will only have one response anyway.
if (response.Batch is null)
{
return;
}

// Transition from GQL to structured queries.
if (response.Query != null)
{
// If the response doesn't have a query, presumably we're in explain-only mode; return.
if (response.Query is null)
{
return;
}
request.Query = response.Query;
}

// Offset/limit/cursor handling.
var query = request.Query;
var batch = response.Batch;
Expand Down

0 comments on commit a5bab39

Please sign in to comment.