From ddaf6e000009e49c1ae2a126d117c4003dfe8f6f Mon Sep 17 00:00:00 2001
From: Malte Bauch <malte.bauch@stud.h-da.de>
Date: Wed, 25 Jan 2023 17:35:02 +0100
Subject: [PATCH] Add missing `err != nil` check

---
 controller/nucleus/principalNetworkDomain.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/controller/nucleus/principalNetworkDomain.go b/controller/nucleus/principalNetworkDomain.go
index 82e00ff54..66d705775 100644
--- a/controller/nucleus/principalNetworkDomain.go
+++ b/controller/nucleus/principalNetworkDomain.go
@@ -149,6 +149,9 @@ func (pnd *pndImplementation) Commit(u uuid.UUID) error {
 
 	// Set all the changes within the network elements model
 	networkElement, err := pnd.networkElementService.Get(store.Query{ID: ch.AssociatedDeviceID()})
+	if err != nil {
+		return err
+	}
 	diff, err := ygot.Diff(ch.PreviousState(), ch.IntendedState())
 	for _, update := range diff.GetUpdate() {
 		opts := []ytypes.SetNodeOpt{&ytypes.InitMissingElements{}, &ytypes.TolerateJSONInconsistencies{}}
-- 
GitLab