Rework of DataFile.base58Digest()

This fixes an NPE when trying to send a file that doesn't exist. It also removes the caching, which we can add again later if it turns out to be needed.
This commit is contained in:
CalDescent 2021-06-19 20:25:25 +01:00
parent 5070c4eea9
commit 7e9b1d5e16

View File

@ -49,7 +49,6 @@ public class DataFile {
protected String filePath; protected String filePath;
private ArrayList<DataFileChunk> chunks; private ArrayList<DataFileChunk> chunks;
protected String base58Digest;
public DataFile() { public DataFile() {
} }
@ -315,10 +314,10 @@ public class DataFile {
} }
public String base58Digest() { public String base58Digest() {
if (this.base58Digest == null) { if (this.digest() != null) {
this.base58Digest = Base58.encode(this.digest()); return Base58.encode(this.digest());
} }
return this.base58Digest; return null;
} }
public String shortDigest() { public String shortDigest() {