[VOL-4117] openonuAdapterGo - HW-test: crash after receiving defective OMCI-msg from ONU

Change-Id: I2fcb302c763242d0382aa5750b679f321351c97b
diff --git a/VERSION b/VERSION
index 04bd18f..9e933da 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.1-dev200
+1.3.1-dev201
diff --git a/internal/pkg/onuadaptercore/omci_cc.go b/internal/pkg/onuadaptercore/omci_cc.go
index 7a85e4a..f371379 100644
--- a/internal/pkg/onuadaptercore/omci_cc.go
+++ b/internal/pkg/onuadaptercore/omci_cc.go
@@ -2957,6 +2957,7 @@
 	return nil
 }
 
+//nolint: gocyclo
 func isSuccessfulResponseWithMibDataSync(omciMsg *omci.OMCI, packet *gp.Packet) bool {
 	for _, v := range responsesWithMibDataSync {
 		if v == omciMsg.MessageType {
@@ -2964,32 +2965,46 @@
 			msgLayer := (*packet).Layer(nextLayer)
 			switch nextLayer {
 			case omci.LayerTypeCreateResponse:
-				if msgLayer.(*omci.CreateResponse).Result == me.Success {
-					return true
+				if resp := msgLayer.(*omci.CreateResponse); resp != nil {
+					if resp.Result == me.Success {
+						return true
+					}
 				}
 			case omci.LayerTypeDeleteResponse:
-				if msgLayer.(*omci.DeleteResponse).Result == me.Success {
-					return true
+				if resp := msgLayer.(*omci.DeleteResponse); resp != nil {
+					if resp.Result == me.Success {
+						return true
+					}
 				}
 			case omci.LayerTypeSetResponse:
-				if msgLayer.(*omci.SetResponse).Result == me.Success {
-					return true
+				if resp := msgLayer.(*omci.SetResponse); resp != nil {
+					if resp.Result == me.Success {
+						return true
+					}
 				}
 			case omci.LayerTypeStartSoftwareDownloadResponse:
-				if msgLayer.(*omci.StartSoftwareDownloadResponse).Result == me.Success {
-					return true
+				if resp := msgLayer.(*omci.StartSoftwareDownloadResponse); resp != nil {
+					if resp.Result == me.Success {
+						return true
+					}
 				}
 			case omci.LayerTypeEndSoftwareDownloadResponse:
-				if msgLayer.(*omci.EndSoftwareDownloadResponse).Result == me.Success {
-					return true
+				if resp := msgLayer.(*omci.EndSoftwareDownloadResponse); resp != nil {
+					if resp.Result == me.Success {
+						return true
+					}
 				}
 			case omci.LayerTypeActivateSoftwareResponse:
-				if msgLayer.(*omci.ActivateSoftwareResponse).Result == me.Success {
-					return true
+				if resp := msgLayer.(*omci.ActivateSoftwareResponse); resp != nil {
+					if resp.Result == me.Success {
+						return true
+					}
 				}
 			case omci.LayerTypeCommitSoftwareResponse:
-				if msgLayer.(*omci.CommitSoftwareResponse).Result == me.Success {
-					return true
+				if resp := msgLayer.(*omci.CommitSoftwareResponse); resp != nil {
+					if resp.Result == me.Success {
+						return true
+					}
 				}
 			}
 		}