linting cleanup
Catch the case when res is undefined.