mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-06 21:13:37 -04:00
Fixed null pointer exception in update containment
This commit is contained in:
@@ -198,7 +198,8 @@ public abstract class SWGObject implements Serializable, Comparable<SWGObject> {
|
||||
// Get a pre-parent-removal list of the observers so we can send create/destroy/update messages
|
||||
Set<SWGObject> oldObservers = getObservers();
|
||||
Player prevOwner = getOwner();
|
||||
oldObservers.add(prevOwner.getCreatureObject());
|
||||
if (prevOwner != null)
|
||||
oldObservers.add(prevOwner.getCreatureObject());
|
||||
|
||||
// Remove this object from the old parent if one exists
|
||||
SWGObject oldParent = null;
|
||||
@@ -213,7 +214,8 @@ public abstract class SWGObject implements Serializable, Comparable<SWGObject> {
|
||||
// Observer notification
|
||||
Player newOwner = getOwner();
|
||||
Set<SWGObject> containerObservers = getObservers();
|
||||
containerObservers.add(newOwner.getCreatureObject());
|
||||
if (newOwner != null)
|
||||
containerObservers.add(newOwner.getCreatureObject());
|
||||
if (prevOwner != newOwner) {
|
||||
if (prevOwner != null)
|
||||
oldObservers.add(prevOwner.getCreatureObject());
|
||||
|
||||
Reference in New Issue
Block a user