If a bot is not connected, show region name "(none)" instead of throwing an exception in the "show bots" command of pCampbot

0.7.3-extended
Justin Clark-Casey (justincc) 2012-05-11 00:37:20 +01:00
parent 802488814f
commit cb4ae39cb9
1 changed files with 3 additions and 1 deletions

View File

@ -302,9 +302,11 @@ namespace pCampBot
{
foreach (Bot pb in m_lBot)
{
Simulator currentSim = pb.Client.Network.CurrentSim;
MainConsole.Instance.OutputFormat(
outputFormat,
pb.Name, pb.Client.Network.CurrentSim.Name, pb.IsConnected ? "Connected" : "Disconnected");
pb.Name, currentSim != null ? currentSim.Name : "(none)", pb.IsConnected ? "Connected" : "Disconnected");
}
}
}