mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Fix crash if selected index is -1 in lava map settings in gui.
This commit is contained in:
parent
4076a8f9d3
commit
ff0932ad22
@ -156,14 +156,19 @@ namespace MCGalaxy.Gui {
|
||||
|
||||
private void lsMapUse_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
SaveLavaMapSettings();
|
||||
if (lsMapUse.SelectedIndex == -1) {
|
||||
groupBox22.Text = "Map settings";
|
||||
pg_lavaMap.SelectedObject = null;
|
||||
return;
|
||||
}
|
||||
|
||||
string name = lsMapUse.Items[lsMapUse.SelectedIndex].ToString();
|
||||
lsLoadedMap = name;
|
||||
groupBox22.Text = "Map settings (" + name + ")";
|
||||
|
||||
try {
|
||||
LavaSurvival.MapSettings m = Server.lava.LoadMapSettings(name);
|
||||
pg_lavaMap.SelectedObject = new LavaMapProperties(m);
|
||||
} catch ( Exception ex ) {
|
||||
} catch (Exception ex) {
|
||||
Server.ErrorLog(ex);
|
||||
pg_lavaMap.SelectedObject = null;
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ using MCGalaxy.Util;
|
||||
|
||||
namespace MCGalaxy.Gui {
|
||||
public partial class PropertyWindow : Form {
|
||||
string lsLoadedMap = "";
|
||||
ZombieProperties zsSettings = new ZombieProperties();
|
||||
LavaProperties lsSettings = new LavaProperties();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user