diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java index e3e58c754fb77c..3dd3e9d8f6d67e 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java @@ -225,6 +225,9 @@ private Object createRuleLegacy(StarlarkThread thread, Dict kwar // TODO(adonovan): is this cast safe? Check. String name = (String) kwargs.get("name"); + if (name == null) { + throw Starlark.errorf("argument 'name' is required"); + } WorkspaceFactoryHelper.addMainRepoEntry(packageBuilder, name, thread.getSemantics()); WorkspaceFactoryHelper.addRepoMappings(packageBuilder, kwargs, name); Rule rule =