Fix in processQuery when res is null