From: Ben Vishny Date: 2010-06-06T05:33:00+09:00 Subject: Processing (potentially) nil method without using nested if Hi all, really stupid question. How can I evaluate the following code without using a nested if.. then statement? if parent.respond_to? "children" if parent.children.size != 0 puts "Has children" end end Ideally I'd like to do: if parent.respond_to? "children" && parent.children.size != 0 puts "Has Children" end But I get an error if parent.children is undefined. Isn't there a way of stopping if the first condition is false? Thanks, Vish -- Posted via http://www.ruby-forum.com/.