Clone of the onuIndcation object to avoid nil pointer
Change-Id: I03e7ca024ec3a4c2419ceb7f3a2cfa7fea6e10d8
diff --git a/VERSION b/VERSION
index 627a3f4..4d0dcda 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.1.1
+4.1.2
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index b9f1e2e..8051057 100644
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -2528,17 +2528,18 @@
select {
// process one indication per onu, before proceeding to the next one
case onuInd := <-onuChannels.indicationChannel:
+ indication := *(proto.Clone(onuInd.indication)).(*oop.Indication)
logger.Debugw(onuInd.ctx, "calling-indication", log.Fields{"device-id": dh.device.Id,
- "ind": onuInd.indication})
- switch onuInd.indication.Data.(type) {
+ "ind": indication})
+ switch indication.Data.(type) {
case *oop.Indication_OnuInd:
- if err := dh.onuIndication(onuInd.ctx, onuInd.indication.GetOnuInd()); err != nil {
+ if err := dh.onuIndication(onuInd.ctx, indication.GetOnuInd()); err != nil {
_ = olterrors.NewErrAdapter("handle-indication-error", log.Fields{
"type": "onu-indication",
"device-id": dh.device.Id}, err).Log()
}
case *oop.Indication_OnuDiscInd:
- if err := dh.onuDiscIndication(onuInd.ctx, onuInd.indication.GetOnuDiscInd()); err != nil {
+ if err := dh.onuDiscIndication(onuInd.ctx, indication.GetOnuDiscInd()); err != nil {
_ = olterrors.NewErrAdapter("handle-indication-error", log.Fields{
"type": "onu-discovery",
"device-id": dh.device.Id}, err).Log()