$language variable causes a lot of notices as non-object I get a lot of notices on my site. 

f.e. 
Notice: Trying to get property of non-object in drupal_lookup_path() (line 77 of /home/srv/www/mysite/includes/path.inc).

Notice: Trying to get property of non-object in template_preprocess_html() (line 2497 of /home/srv/www/mysite/includes/theme.inc).

and many other.
And also warning:
Warning: Attempt to assign property of non-object in template_preprocess_html() (line 2497 of /home/srv/www/mysite/includes/theme.inc).

I don't know how to fix this. Thanks to all for help.
For your issues you can refer 

these links have given some patch for these notices 


https://www.drupal.org/node/1907684
https://www.drupal.org/node/1104822 
https://www.drupal.org/node/1853170