Notice: Trying to get property of non-object in function MY_MODULE_form_comment_form_alter()
You have the wrong function signature. It is supposed to be:

hook_form_FORM_ID_alter(&amp;$form, &amp;$form_state, $form_id)


In your function, $comment_count is set as the form_id, and $comment will always be null.

Set it to the signature above, then use $form['nid'] and $form['cid']. To get the comment count on the node, inspect at $form['#node']->comment_count

Here is a replacement code for what you are trying to do:

function MY_MODULE_form_comment_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form['#node']-&gt;comment_count){
    // node has comments
    $form['#attached']['css'] = array(
        drupal_get_path('module', 'MY_MODULE') . '/MY_MODULE.css.', 'file');
  }
  else {
    // no comments on the node
    $form['#attached']['css'] = array(
      drupal_get_path('module', 'MY_MODULE') . '/MY_MODULE2.css.', 'file');
    $form['#attributes']['class'][] = 'new-comment-form';
  }
}