Trying to get property of non-obJect Custom Module
This error occurs when you are getting language from a non object. To fix this check that whether the node is a object and check that 'language' exists in the $node or not.

if(is_object($node) &amp;&amp; isset($node-&gt;language))


Then check the stuff that you are going to do.