Skip to content

Commit

Permalink
Fix NPE in equals
Browse files Browse the repository at this point in the history
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
  • Loading branch information
MelleD committed May 18, 2016
1 parent 05615a9 commit 96af492
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -339,7 +339,7 @@ public void write(final int i) throws IOException {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (fileName == null ? 0 : fileName.hashCode());
result = prime * result + ((fileName == null) ? 0 : fileName.hashCode());
return result;
}

Expand All @@ -348,12 +348,17 @@ public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof UploadHandler)) {
if (obj == null) {
return false;
}
final UploadHandler other = (UploadHandler) obj;
if (fileName == null && other.fileName != null) {
if (getClass() != obj.getClass()) {
return false;
}
final UploadHandler other = (UploadHandler) obj;
if (fileName == null) {
if (other.fileName != null) {
return false;
}
} else if (!fileName.equals(other.fileName)) {
return false;
}
Expand Down

0 comments on commit 96af492

Please sign in to comment.