From b63b0c54e41b2d926adf9142184b6c7d264a911e Mon Sep 17 00:00:00 2001
From: Fabian Seidl <fabian.seidl@h-da.de>
Date: Mon, 24 Feb 2025 07:28:31 +0000
Subject: [PATCH] Fix access to value of var in gNMI Update

See merge request danet/gosdn!1219
---
 controller/nucleus/networkElementWatcher.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/controller/nucleus/networkElementWatcher.go b/controller/nucleus/networkElementWatcher.go
index a81fd7a9c..9aec23185 100644
--- a/controller/nucleus/networkElementWatcher.go
+++ b/controller/nucleus/networkElementWatcher.go
@@ -247,11 +247,11 @@ func (n *NetworkElementWatcher) handleSubscribeResponseUpdate(resp *gpb.Subscrib
 
 		switch v := update.GetVal().GetValue().(type) {
 		case *gpb.TypedValue_StringVal:
-			pathsAndValues[pathString] = update.Val.GetStringVal()
+			pathsAndValues[pathString] = update.GetVal().GetStringVal()
 		case *gpb.TypedValue_JsonIetfVal:
 			pathsAndValues[pathString] = string(update.GetVal().GetJsonIetfVal())
 		case *gpb.TypedValue_UintVal:
-			pathsAndValues[pathString] = fmt.Sprintf("%d", update.Val.GetUintVal())
+			pathsAndValues[pathString] = fmt.Sprintf("%d", update.GetVal().GetUintVal())
 		default:
 			log.Errorf("The given value of type: %T, provided by a SubResponse from network element with ID: %s is not supported", v, subscriptionInfo.NetworkElementID)
 			return
-- 
GitLab