I would suggest checking for an object it it is at all possible that the object does not exist.
For example, whenever I have
x = document.getElementById( 'idAttribute' );
I verify that x is not null.
However, you will find lots, and lots of JavaScript on the web where this kind of checking is not done. In these cases, you (or the user) are likely to see a message indicating that "x" is not an object.
I tend to be paranoid, and have code to verify values before they are used.