File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/com/bazel_diff Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class BazelSourceFileTargetImpl implements BazelSourceFileTarget {
2424 String filenameSubstring = name .substring (2 );
2525 String filenamePath = filenameSubstring .replaceFirst (":" , "/" );
2626 File sourceFile = new File (workingDirectory .toString (), filenamePath );
27- if (sourceFile .canRead ()) {
27+ if (sourceFile .isFile () && sourceFile . canRead ()) {
2828 ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
2929 outputStream .write (Files .readAllBytes (sourceFile .toPath ()));
3030 outputStream .write (digest );
@@ -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 }
You can’t perform that action at this time.
0 commit comments