Replace NoMethodError catching with respond_to?

Thanks to @stevegraham for pointing this out!