Fixed "Uncaught TypeError: Cannot read property 'sendKeys' of null" for null responses

Previous conditional statement would throw a TypeError complaining about res being null. This was due to a fact that typeof(null) returns 'object'.