I couldn't turn up any great links on the subject, but Objective-C (as used in Apple's Cocoa development) uses this pattern. Calling a method on a nil object returns nil. It'd be similar to this Perl, which would print undefined:
# this would work if it were Objective-C
# using Perl's syntax
my $foo = undef;
my $result = $foo->message;
print "undefined\n"
if not defined $result;