Fixed null error

This commit is contained in:
Treeku
2014-05-02 22:08:13 +01:00
parent 57dcb72718
commit ff827a2902
+10 -2
View File
@@ -544,7 +544,11 @@ public class ObjectService implements INetworkDispatch {
while (cursor.hasNext()) {
SWGObject object = (SWGObject) cursor.next();
if (object != null && object.getCustomName() != null && customName.length() > 0 && object.getCustomName().equals(customName)) {
if (object == null) {
continue;
}
if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().equals(customName)) {
return object;
}
}
@@ -572,7 +576,11 @@ public class ObjectService implements INetworkDispatch {
while (cursor.hasNext()) {
SWGObject object = (SWGObject) cursor.next();
if (object != null && object.getCustomName() != null && customName.length() > 0 && object.getCustomName().startsWith(customName)) {
if (object == null) {
continue;
}
if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().startsWith(customName)) {
return object;
}
}