diff --git a/lib/manager/bazel/extract.ts b/lib/manager/bazel/extract.ts
index 715bef242f12989573bb9db00bcda477ecbd0673..f97ba65b08f2f21caaff569e491c2cc0b0bec58c 100644
--- a/lib/manager/bazel/extract.ts
+++ b/lib/manager/bazel/extract.ts
@@ -172,10 +172,13 @@ export function extractPackageFile(content: string): PackageFile | null {
       if (commit) {
         dep.currentDigest = commit;
       }
-      const repo = parse(remote).substring('https://github.com/'.length);
-      dep.datasource = 'github';
-      dep.lookupName = repo;
-      deps.push(dep);
+      const githubURL = parse(remote);
+      if (githubURL) {
+        const repo = githubURL.substring('https://github.com/'.length);
+        dep.datasource = 'github';
+        dep.lookupName = repo;
+        deps.push(dep);
+      }
     } else if (
       depType === 'go_repository' &&
       depName &&