Skip to content

Commit

Permalink
Incomplete fix for NPEs in SmbShareInfo (#108, #136)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbechler committed Feb 17, 2019
1 parent 1dfe0b5 commit ebebc68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/jcifs/internal/smb1/net/SmbShareInfo.java
Expand Up @@ -19,6 +19,8 @@
package jcifs.internal.smb1.net;


import java.util.Objects;

import jcifs.SmbConstants;
import jcifs.smb.FileEntry;
import jcifs.util.Hexdump;
Expand Down Expand Up @@ -126,15 +128,15 @@ public long length () {
public boolean equals ( Object obj ) {
if ( obj instanceof SmbShareInfo ) {
SmbShareInfo si = (SmbShareInfo) obj;
return this.netName.equals(si.netName);
return Objects.equals(this.netName, si.netName);
}
return false;
}


@Override
public int hashCode () {
return this.netName != null ? this.netName.hashCode() : 0;
return Objects.hashCode(this.netName);
}


Expand Down

0 comments on commit ebebc68

Please sign in to comment.