diff --git a/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java b/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java index b3c4bda4f..aadc69b80 100644 --- a/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java +++ b/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java @@ -73,6 +73,10 @@ public HttpArchiveDepsList getHttpArchiveDeps( httpArchive = currentHttpArchive; } } + if (httpArchive.getName().isEmpty()) { + log.atWarning().log("Can't find %s http_archive in WORKSPACE file", httpArchiveName); + continue; + } if (areCommitIdsTheSame(httpArchiveName, getCommitId(httpArchive.getStripPrefix()))) { log.atInfo().log( "Commit id in WORKSPACE file and commit id in \'%s\' file for \'%s\' http_archive " @@ -231,7 +235,11 @@ private boolean areCommitIdsTheSame(String httpArchiveName, String workspaceComm break; } } - return workspaceCommitId.equals(prototxtCommitId); + if (prototxtCommitId.isEmpty()) { + return false; + } else { + return workspaceCommitId.equals(prototxtCommitId); + } } private String shortenTarget(String fullTargetName) {