diff --git a/private/bufnew/bufmodule/module_set_builder.go b/private/bufnew/bufmodule/module_set_builder.go index 9fb6085993..bf13ae8fec 100644 --- a/private/bufnew/bufmodule/module_set_builder.go +++ b/private/bufnew/bufmodule/module_set_builder.go @@ -108,6 +108,10 @@ func (b *moduleSetBuilder) AddModuleForBucket( b.errs = append(b.errs, errBuildAlreadyCalled) return b } + if bucketID == "" { + b.errs = append(b.errs, errors.New("BucketID is required when calling AddModuleForBucket")) + return b + } addModuleForBucketOptions := newAddModuleForBucketOptions() for _, option := range options { option(addModuleForBucketOptions)