[bugfix] query-stats panics when both query and error are nil
#13744
+24
−0
nil
#13744