Shouldn't this just return false if it's not an instance of Response? The stated return value of the method is type boolean and the default return value of a function without a return statement is null, so just putting a "return false" at the end should do it.