Which is where the exists used in the firsttwo original replies to the OP comes in handy...
Because of things like this, I find myself using defined and exists a lot when writing code. It may be more verbose but better safe than sorry... I hope I'm not too much of a Captain Obvious :)