[VOL-5390]-avoid nil pointer exeption during onu image upgrade

Change-Id: I96f90f998837758c6a372e59fb6757ca9b688e73
Signed-off-by: Akash Soni <akash.soni@radisys.com>
diff --git a/internal/pkg/swupg/omci_onu_upgrade.go b/internal/pkg/swupg/omci_onu_upgrade.go
index 64b5299..2143a10 100755
--- a/internal/pkg/swupg/omci_onu_upgrade.go
+++ b/internal/pkg/swupg/omci_onu_upgrade.go
@@ -1642,6 +1642,12 @@
 		oFsm.abortOnOmciError(ctx, false)
 		return
 	}
+	if msgObj.EntityClass != me.SoftwareImageClassID {
+		logger.Errorw(ctx, "Class id mismatch for software image upgrade",
+			log.Fields{"device-id": oFsm.deviceID, "received ClassId": msgObj.EntityClass, "expected ClassId": me.SoftwareImageClassID})
+		oFsm.abortOnOmciError(ctx, false)
+		return
+	}
 	logger.Debugw(ctx, "OnuUpgradeFsm SwImage GetResponse data", log.Fields{
 		"device-id": oFsm.deviceID, "data-fields": msgObj})
 	if msgObj.EntityClass == oFsm.pLastTxMeInstance.GetClassID() &&