Merge pull request #316 from middas/general-devel

General devel
This commit is contained in:
Lucas Nicodemus 2011-12-26 14:59:55 -08:00
commit 70874a3462
2 changed files with 15 additions and 6 deletions

View file

@ -69,7 +69,8 @@ namespace TShockAPI
foreach (TSPlayer player in TShock.Players) foreach (TSPlayer player in TShock.Players)
{ {
if (player.IsLoggedIn) // prevent null point exceptions
if (player != null && player.IsLoggedIn)
{ {
TShock.InventoryDB.InsertPlayerData(player); TShock.InventoryDB.InsertPlayerData(player);
} }

View file

@ -663,6 +663,9 @@ namespace TShockAPI.DB
} }
public void SetAllowedGroups( String groups ) public void SetAllowedGroups( String groups )
{
// prevent null pointer exceptions
if (!string.IsNullOrEmpty(groups))
{ {
List<String> groupArr = groups.Split(',').ToList(); List<String> groupArr = groups.Split(',').ToList();
@ -671,6 +674,11 @@ namespace TShockAPI.DB
AllowedGroups = groupArr; AllowedGroups = groupArr;
} }
else
{
AllowedGroups = new List<string>();
}
}
public void RemoveID(int id) public void RemoveID(int id)
{ {