Avoid NPE
This commit is contained in:
parent
5c1e91c397
commit
488c4e7cca
|
@ -6,6 +6,7 @@ import static java.util.Collections.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class SeriesInfo implements Serializable {
|
public class SeriesInfo implements Serializable {
|
||||||
|
|
||||||
|
@ -175,14 +176,14 @@ public class SeriesInfo implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return id;
|
return id == null ? 0 : id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
if (object instanceof SeriesInfo) {
|
if (object instanceof SeriesInfo) {
|
||||||
SeriesInfo other = (SeriesInfo) object;
|
SeriesInfo other = (SeriesInfo) object;
|
||||||
return id.equals(other.id) && database.equals(other.database);
|
return Objects.equals(id, other.id) && Objects.equals(database, other.database);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue