[PATCH] Verify that return rows exist before extracting columns