How to acess node object in hook_form_alter
Not all the forms contains a reference to a node. It is just some node forms which contain a node object, but hook_form_alter() is called for every form being output from Drupal.

What you need to do is the following:


Check $form['#node'] is set  

if (isset($form['#node'])) {
  // …
}

Use a different hook, such as hook_form_node_form_alter() if you want to alter the node edit form for any content type, or hook_form_$type_node_form_alter() for the node edit form of the $type content type