Make sure we don't try to print to an undefined filehandle, if there's an error when...
authorDan Boger <zigdon@irc.peeron.com>
Thu, 28 Jan 2010 23:09:30 +0000 (15:09 -0800)
committerDan Boger <zigdon@irc.peeron.com>
Thu, 28 Jan 2010 23:09:30 +0000 (15:09 -0800)
twirssi.pl

index c133378..64c344f 100644 (file)
@@ -524,7 +524,7 @@ sub cmd_login {
                 );
             } else {
                 $twit = Net::Twitter->new(
                 );
             } else {
                 $twit = Net::Twitter->new(
-                    traits       => [ 'API::REST', 'OAuth', 'API::Search' ],
+                    traits => [ 'API::REST', 'OAuth', 'API::Search' ],
                     consumer_key => 'BZVAvBma4GxdiRwXIvbnw',
                     consumer_secret =>
                       '0T5kahwLyb34vciGZsgkA9lsjtGCQ05vxVE2APXM',
                     consumer_key => 'BZVAvBma4GxdiRwXIvbnw',
                     consumer_secret =>
                       '0T5kahwLyb34vciGZsgkA9lsjtGCQ05vxVE2APXM',
@@ -955,7 +955,8 @@ sub load_friends {
     };
 
     if ($@) {
     };
 
     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;
     }
 
         return;
     }