added null check to nested user hash
This commit is contained in:
@@ -18,9 +18,6 @@
|
|||||||
|
|
||||||
package nodash.models;
|
package nodash.models;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.ObjectOutputStream;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
@@ -121,7 +118,6 @@ public abstract class NoUser implements Serializable {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final byte[] createHash() {
|
public final byte[] createHash() {
|
||||||
try {
|
try {
|
||||||
List<Object> items = new ArrayList<Object>();
|
|
||||||
Comparator<Field> fieldComp = new Comparator<Field>() {
|
Comparator<Field> fieldComp = new Comparator<Field>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(Field o1, Field o2) {
|
public int compare(Field o1, Field o2) {
|
||||||
@@ -141,7 +137,10 @@ public abstract class NoUser implements Serializable {
|
|||||||
if (field.isAnnotationPresent(NoHash.class)) {
|
if (field.isAnnotationPresent(NoHash.class)) {
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
toString.append("|");
|
toString.append("|");
|
||||||
toString.append(field.get(this).toString());
|
Object item = field.get(this);
|
||||||
|
if (item != null) {
|
||||||
|
toString.append(field.get(this).toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user