Skip to content

Commit 3c8a37d

Browse files
Attempt to fix issue with -a flag
Fixes a null pointer dereference when using the hash all targets flag `-a`
1 parent b0dc538 commit 3c8a37d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/bazel_diff/BazelSourceFileTarget.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public String getName() {
4444
@Override
4545
public byte[] getDigest() throws NoSuchAlgorithmException {
4646
MessageDigest finalDigest = MessageDigest.getInstance("SHA-256");
47-
finalDigest.update(digest);
47+
if (digest != null) {
48+
finalDigest.update(digest);
49+
}
4850
finalDigest.update(name.getBytes());
4951
return finalDigest.digest();
5052
}

0 commit comments

Comments
 (0)