Bug 7684: multiple fixes for inventory
[koha.git] / C4 / Templates.pm
index 0b93971..2d2304f 100644 (file)
@@ -360,7 +360,7 @@ sub getlanguage {
     }
 
     # cookie
-    if ( $query->cookie('KohaOpacLanguage') ) {
+    if ($query and $query->cookie('KohaOpacLanguage') ) {
         $lang = $query->cookie('KohaOpacLanguage');
         $lang =~ s/[^a-zA-Z_-]*//; # sanitize cookie
     }