mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-01 02:16:15 -04:00
Added ObjectService planet null check
Somewhere, someone is passing a null Planet object to createObject()
This commit is contained in:
@@ -244,6 +244,18 @@ public class ObjectService implements INetworkDispatch {
|
||||
else
|
||||
isSnapshot = !overrideSnapshot;
|
||||
|
||||
if (planet == null) {
|
||||
System.err.println("Planet is null in createObject for some reason.");
|
||||
|
||||
try {
|
||||
throw new Exception();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
planet = core.terrainService.getPlanetByID(0);
|
||||
}
|
||||
|
||||
if(Template.startsWith("object/creature")) {
|
||||
|
||||
object = new CreatureObject(objectID, planet, position, orientation, Template);
|
||||
@@ -344,7 +356,11 @@ public class ObjectService implements INetworkDispatch {
|
||||
return null;
|
||||
}
|
||||
|
||||
object.setPlanetId(planet.getID());
|
||||
if (planet != null) {
|
||||
object.setPlanetId(planet.getID());
|
||||
} else {
|
||||
object.setPlanetId(0);
|
||||
}
|
||||
|
||||
object.setAttachment("customServerTemplate", customServerTemplate);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user