Permalink
Browse files

shift() only when called with an argument.

  • Loading branch information...
1 parent 54084d2 commit 028dca3682d716de614c187af1a2aeee9fa85612 @trizen committed Feb 18, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 WWW-YoutubeViewer/bin/gtk-youtube-viewer
@@ -1200,7 +1200,7 @@ sub change_subscription_page {
no strict 'refs';
foreach my $feed_name (@{WWW::YoutubeViewer::feed_methods}) {
*{__PACKAGE__ . '::' . $feed_name} = sub {
- my $user = (!ref $_[0]) ? shift() : $gui->get_object('news_users')->get_text;
+ my $user = (@_ && !ref $_[0]) ? shift() : $gui->get_object('news_users')->get_text;
my $code = \&{"WWW::YoutubeViewer::get_$feed_name"};
my $videos = $yv_obj->$code($user);

0 comments on commit 028dca3

Please sign in to comment.