I often face the situation when if condition A (for example !@object.nil?
) is false
, condition B, when checked, can raise an error (for example @object.some_method -> undefined method 'some_method' for nil:NilClass
).
I tested it in console, but could't get some full data.
1) Is it safe to use and
/&&
when if first conditional is false
, second can lead into an error?
2) What about or
?