[VOL-5248] - Flow audit controll fixes

Change-Id: I78989c8a9019f04545509d166d11bb8e2b478344
diff --git a/internal/pkg/application/application.go b/internal/pkg/application/application.go
index 371cd84..5a7dc27 100644
--- a/internal/pkg/application/application.go
+++ b/internal/pkg/application/application.go
@@ -1790,10 +1790,12 @@
 	}
 	flowEventMap.MapLock.Unlock()
 	flowEvent := event.(*FlowEvent)
-	vs := flowEvent.eventData.(*VoltService)
-	vs.ServiceLock.RLock()
-	defer vs.ServiceLock.RUnlock()
-	return vs.FlowPushCount[cookie] == controller.GetController().GetMaxFlowRetryAttempt()
+	if vs, ok := flowEvent.eventData.(*VoltService); ok {
+		vs.ServiceLock.RLock()
+		defer vs.ServiceLock.RUnlock()
+		return vs.FlowPushCount[cookie] == controller.GetController().GetMaxFlowRetryAttempt()
+	}
+	return false
 }
 
 func pushFlowFailureNotif(flowStatus intf.FlowStatus) {
diff --git a/internal/pkg/application/service.go b/internal/pkg/application/service.go
index 38d41c2..2c16f29 100644
--- a/internal/pkg/application/service.go
+++ b/internal/pkg/application/service.go
@@ -1054,7 +1054,10 @@
 		vs.DeactivateInProgress = oper.DeactivateInProgress
 		vs.BwAvailInfo = oper.BwAvailInfo
 		vs.Device = oper.Device
-		vs.FlowPushCount = cfg.FlowPushCount
+		// FlowPushCount is newly introduced map and it can be nil when VGC is upgraded. Hence adding a nil check to handle backward compatibility
+		if cfg.FlowPushCount != nil {
+			vs.FlowPushCount = cfg.FlowPushCount
+		}
 		vs.ServiceDeactivateReason = cfg.ServiceDeactivateReason
 	} else {
 		// Sorting Pbit from highest