Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix player sync #777

Merged
merged 2 commits into from
Mar 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Slim/Control/Commands.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ through Request.pm and the mechanisms it defines.

use strict;

use Scalar::Util qw(blessed);
use Scalar::Util qw(blessed looks_like_number);
use File::Spec::Functions qw(catfile);
use File::Basename qw(basename);
use Digest::MD5 qw(md5_hex);
Expand Down Expand Up @@ -3078,7 +3078,7 @@ sub syncCommand {
# try a player index
if (!defined $buddy) {
my @clients = Slim::Player::Client::clients();
if (defined $clients[$newbuddy]) {
if (looks_like_number($newbuddy) && defined $clients[$newbuddy]) {
$buddy = $clients[$newbuddy];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the new check to the outer condition. There's no need to read the @clients list if the $newbuddy isn't a number.

And feel free to update Changelog8.html too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the PR

}
}
Expand Down