mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +01:00
Fix template nullpointer
This commit is contained in:
parent
c34b097676
commit
f6274317d6
Binary file not shown.
@ -46,6 +46,10 @@ public class PacketExConfigureHost implements PacketIn, PacketOut {
|
|||||||
@Override
|
@Override
|
||||||
public void execute(JSONObject data) {
|
public void execute(JSONObject data) {
|
||||||
host.host = new YAMLSection(data.getJSONObject("host"));
|
host.host = new YAMLSection(data.getJSONObject("host"));
|
||||||
|
for (SubCreator.ServerTemplate template : host.templates.values()) {
|
||||||
|
Util.deleteDirectory(template.getDirectory());
|
||||||
|
}
|
||||||
|
host.templates.clear();
|
||||||
UniversalFile templates = new UniversalFile(host.runtime, "net:ME1312:SubServers:Host:Library:Files:Templates");
|
UniversalFile templates = new UniversalFile(host.runtime, "net:ME1312:SubServers:Host:Library:Files:Templates");
|
||||||
for (String name : data.getJSONObject("templates").keySet()) {
|
for (String name : data.getJSONObject("templates").keySet()) {
|
||||||
try {
|
try {
|
||||||
|
@ -1,17 +1,10 @@
|
|||||||
package net.ME1312.SubServers.Host.Network.Packet;
|
package net.ME1312.SubServers.Host.Network.Packet;
|
||||||
|
|
||||||
|
|
||||||
import net.ME1312.SubServers.Host.Executable.SubCreator;
|
|
||||||
import net.ME1312.SubServers.Host.Library.Config.YAMLConfig;
|
|
||||||
import net.ME1312.SubServers.Host.Library.Config.YAMLSection;
|
|
||||||
import net.ME1312.SubServers.Host.Library.UniversalFile;
|
|
||||||
import net.ME1312.SubServers.Host.Library.Util;
|
|
||||||
import net.ME1312.SubServers.Host.Library.Version.Version;
|
import net.ME1312.SubServers.Host.Library.Version.Version;
|
||||||
import net.ME1312.SubServers.Host.Network.PacketIn;
|
import net.ME1312.SubServers.Host.Network.PacketIn;
|
||||||
import net.ME1312.SubServers.Host.ExHost;
|
import net.ME1312.SubServers.Host.ExHost;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -48,10 +41,6 @@ public class PacketInReset implements PacketIn {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
host.log.error.println(e);
|
host.log.error.println(e);
|
||||||
}
|
}
|
||||||
for (SubCreator.ServerTemplate template : host.templates.values()) {
|
|
||||||
Util.deleteDirectory(template.getDirectory());
|
|
||||||
}
|
|
||||||
host.templates.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user