Skip to content

Commit

Permalink
Merge pull request #593 from Jougan-0/addMissingCheck
Browse files Browse the repository at this point in the history
don't register the models that don't have models or relationshisp w/s…
  • Loading branch information
Jougan-0 authored Sep 21, 2024
2 parents 1366959 + 7004f8f commit 4abc81b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/registration/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ register will return an error if it is not able to register the `model`.
If there are errors when registering other entities, they are handled properly but does not stop the registration process.
*/
func (rh *RegistrationHelper) register(pkg PackagingUnit) {
if len(pkg.Components) == 0 && len(pkg.Relationships) == 0 {
//silently exit if the model does not conatin any components or relationships
return
}
// 1. Register the model
model := pkg.Model

Expand Down

0 comments on commit 4abc81b

Please sign in to comment.