[Slim-Checkins] r9365 - in /trunk/server/Plugins/Health: HTML/EN/plugins/Health/index.html Plugin.pm

adrian at svn.slimdevices.com adrian at svn.slimdevices.com
Sat Sep 2 03:10:28 PDT 2006


Author: adrian
Date: Sat Sep  2 03:10:24 2006
New Revision: 9365

URL: http://svn.slimdevices.com?rev=9365&view=rev
Log:
Bug: 4031
Description: don't crash in Heath plugin if no client

Modified:
    trunk/server/Plugins/Health/HTML/EN/plugins/Health/index.html
    trunk/server/Plugins/Health/Plugin.pm

Modified: trunk/server/Plugins/Health/HTML/EN/plugins/Health/index.html
URL: http://svn.slimdevices.com/trunk/server/Plugins/Health/HTML/EN/plugins/Health/index.html?rev=9365&r1=9364&r2=9365&view=diff
==============================================================================
--- trunk/server/Plugins/Health/HTML/EN/plugins/Health/index.html (original)
+++ trunk/server/Plugins/Health/HTML/EN/plugins/Health/index.html Sat Sep  2 03:10:24 2006
@@ -88,7 +88,9 @@
 	[% END %]
 
 	<h4>[% "PLUGIN_HEALTH_PERF_STATISTICS" | string %]</h4>
-	<p><a href="[% webroot %]plugins/Health/player.html?player=[% player | uri	%]">[% "PLUGIN_HEALTH_PLAYER" | string %] : [% playername %]</a></p>
+	[% IF player %]
+		<p><a href="[% webroot %]plugins/Health/player.html?player=[% player | uri	%]">[% "PLUGIN_HEALTH_PLAYER" | string %] : [% playername %]</a></p>
+	[% END %]
 	<p><a href="[% webroot %]plugins/Health/server.html?player=[% player | uri %]">[% "PLUGIN_HEALTH_SERVER" | string %]</a></p>
 	<p><a href="[% webroot %]plugins/Health/index.html?perf=off">[% "PLUGIN_HEALTH_PERF_DISABLE" | string %]</a></p>
     <p></p>

Modified: trunk/server/Plugins/Health/Plugin.pm
URL: http://svn.slimdevices.com/trunk/server/Plugins/Health/Plugin.pm?rev=9365&r1=9364&r2=9365&view=diff
==============================================================================
--- trunk/server/Plugins/Health/Plugin.pm (original)
+++ trunk/server/Plugins/Health/Plugin.pm Sat Sep  2 03:10:24 2006
@@ -274,7 +274,7 @@
 
 	foreach my $mon (@perfmonLogs) {
 
-		next if ($type ne $mon->{'type'});
+		next if ($type ne $mon->{'type'} || $type eq 'player' && !$client);
 
 		my $monitor = ($type eq 'server') ? ${$mon->{'monitor'}} : $mon->{'monitor'}($client);
 
@@ -298,7 +298,7 @@
 		};
 	}
 
-	$params->{'playername'} = $client->name();
+	$params->{'playername'} = $client->name() if $client;
 	$params->{'type'} = $type;
 	$params->{'graphs'} = \@graphs;
 



More information about the checkins mailing list