out of range check when reading chat colors.
This commit is contained in:
parent
279b8ef9e2
commit
75f3d3c046
1 changed files with 6 additions and 3 deletions
|
|
@ -187,9 +187,12 @@ namespace TShockAPI.DB
|
|||
group.AddPermission(commands[i].Trim());
|
||||
}
|
||||
String[] chatcolour = reader.Get<String>("ChatColor").Split(',');
|
||||
byte.TryParse(chatcolour[0], out group.R);
|
||||
byte.TryParse(chatcolour[1], out group.G);
|
||||
byte.TryParse(chatcolour[2], out group.B);
|
||||
if (chatcolour.Length == 3)
|
||||
{
|
||||
byte.TryParse(chatcolour[0], out group.R);
|
||||
byte.TryParse(chatcolour[1], out group.G);
|
||||
byte.TryParse(chatcolour[2], out group.B);
|
||||
}
|
||||
groups.Add(group);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue