]> git.sommitrealweird.co.uk Git - twirssi-net-twitter-lite.git/blobdiff - twirssi.pl
Make sure we don't try to print to an undefined filehandle, if there's an error when...
[twirssi-net-twitter-lite.git] / twirssi.pl
index b0e31068fd04a20f3b94ed057cf33068c71f81b1..64c344f430e47e2a6608458db55eb2c13def538c 100644 (file)
@@ -518,13 +518,13 @@ sub cmd_login {
             {
                 $twit = Net::Twitter->new(
                     identica => 1,
-                    traits   => [ 'API::REST' ],
+                    traits   => [ 'API::REST', 'API::Search' ],
                     source   => "twirssi",
                     ssl      => !Irssi::settings_get_bool("twirssi_avoid_ssl"),
                 );
             } else {
                 $twit = Net::Twitter->new(
-                    traits       => [ 'API::REST', 'OAuth' ],
+                    traits => [ 'API::REST', 'OAuth', 'API::Search' ],
                     consumer_key => 'BZVAvBma4GxdiRwXIvbnw',
                     consumer_secret =>
                       '0T5kahwLyb34vciGZsgkA9lsjtGCQ05vxVE2APXM',
@@ -955,7 +955,8 @@ sub load_friends {
     };
 
     if ($@) {
-        print $fh "type:debug Error during friends list update.  Aborted.\n";
+        print $fh "type:debug Error during friends list update.  Aborted.\n"
+          if $fh;
         return;
     }