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

This commit is contained in:
Justin Clark-Casey (justincc)
2012-05-11 00:37:20 +01:00
parent 903cff9264
commit ab4e6a02a5

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");
}
}
}