Theming property non-object when transversing the $node object I'm getting this error when I run the code below, in reference to $color module: 

Notice: Trying to get property of non-object in cotyhouse_preprocess_html() 




function cotyhouse_preprocess_html(&amp;$vars){
  // Check if on an article node page
  $node = menu_get_object('node');

  $color = $node-&gt;field_title_color;

  print $color;

}    


When i output it via dpm, it says its an object, so im a bit confused why it would throw an error. The field value does indeed come through.
menu_get_object('node') should be: menu_get_object()

No need for node as its implied when you call that function. 

Also you need to put it in a conditional:

if($node = menu_get_object()) {       }