Bugzilla – Bug 2223
RandomPlay crashes when there's no client connecte
Last modified: 2008-09-15 14:37:04 UTC
I wanted to play a song mix on no player :-) 2005-09-30 13:32:50.5337 Backtrace: frame 0: Slim::Utils::Misc::assert (D:/slimskin/Slim/Player/Sync.pm line 415) frame 1: Slim::Player::Sync::masterOrSelf (D:/slimskin/Slim/Player/Source.pm line 1052) frame 2: Slim::Player::Source::streamingSongIndex (D:/slimskin/Plugins/ RandomPlay/Plugin.pm line 103) frame 3: Plugins::RandomPlay::Plugin::playRandom (D:/slimskin/Plugins/ RandomPlay/Plugin.pm line 375) frame 4: Plugins::RandomPlay::Plugin::handleWebMix (D:/slimskin/Slim/Web/ HTTP.pm line 760) frame 5: Slim::Web::HTTP::generateHTTPResponse (D:/slimskin/Slim/Web/HTTP.pm line 675) frame 6: Slim::Web::HTTP::processURL (D:/slimskin/Slim/Web/HTTP.pm line 536) frame 7: Slim::Web::HTTP::processHTTP (D:/slimskin/Slim/Networking/Select.pm line 115) frame 8: Slim::Networking::Select::select (slimserver.pl line 634) frame 9: main::idle (slimserver.pl line 578) frame 10: main::main (slimserver.pl line 1213) Here's the problem. D:/slimskin/Slim/Player/Sync.pm, line 415: 405 # returns the master if it's a slave, otherwise returns undef 406 sub isSlave { 407 my $client = shift; 408 return undef unless $client; 409 return $client->master; 410 } 411 412 sub masterOrSelf { 413 my $client = shift; 414 415 assert($client); 416 417 return $client->master || $client; 418 } 419 420 sub isSynced { 421 my $client = shift; 422 return (scalar(@{$client->slaves}) || $client->master); 423 } 424 425 sub syncGroupPref { Can't call method "master" on an undefined value at D:/slimskin/Slim/Player/ Sync.pm line 417, <SRC> line 456. 2005-09-30 13:32:50.6393 Shutting down plugins...
I've got a version of RandomPlay that displays a player not found message on the web page and therefore doesn't let the mix be started. In addition, I'll put some null client checks into the code. I can't help thinking that the server should be a bit more immune to the call being made, however.
Patch to RandomPlay posted at http://forums.slimdevices.com/showpost.php?p=55193. This changes the web page as described previously and also adds a check into Plugin.pm, just in case someone enters an url directly.
committed to trunk at change 4499
There are 536 bugs in the database with targets of '---' that were fixed prior to new year 2006. I am setting them to targets of 6.2.1 to keep them from showing up in my queries.