hook_node_presave () showing error When I am inserting a new article there is an error -


  Notice: Undefined property: stdClass::$field_tags in
  hook_node_presave() (line 344 of
  D:\wamp\www...)


The code for line 344 is-

function mltag_node_presave($node) {
...
$count = count($node-&gt;field_tags[$node-&gt;language]); //line 344
..
}


This error only shows up when adding a new article, and not when editing an article.
The line 344 is just to count the number of term-ids in the textfield for tags.
Any suggestions ??

EDIT - field_tags is the name of the default Tag textfield added in the add-article page
I think you need to do an isset($node->field_tags[$node->language]), if it is empty $node->field_tags[$node->language] will not exist. Could you check if it is only articles with the empty field_tags that are affected?