mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-15 00:07:39 -04:00
Additional null checks
This commit is contained in:
@@ -524,6 +524,9 @@ public class ObjectService implements INetworkDispatch {
|
||||
}
|
||||
|
||||
public SWGObject getObjectByCustomName(String customName) {
|
||||
if (customName == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
synchronized(objectList) {
|
||||
|
||||
@@ -538,16 +541,22 @@ public class ObjectService implements INetworkDispatch {
|
||||
|
||||
ODBCursor cursor = core.getSWGObjectODB().getCursor();
|
||||
|
||||
while(cursor.hasNext()) {
|
||||
if(((SWGObject) cursor.next()).getCustomName().equals(customName))
|
||||
return (SWGObject) cursor.next();
|
||||
while (cursor.hasNext()) {
|
||||
SWGObject object = (SWGObject) cursor.next();
|
||||
|
||||
if (object != null && object.getCustomName() != null && customName.length() > 0 && object.getCustomName().equals(customName)) {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public SWGObject getObjectByFirstName(String customName) {
|
||||
if (customName == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
synchronized(objectList) {
|
||||
for(SWGObject obj : objectList.values()) {
|
||||
if(obj.getCustomName() == null)
|
||||
|
||||
Reference in New Issue
Block a user