@@ -67,6 +67,11 @@ func (sc *statsComputer) computeMutableStateStats(req *InternalGetWorkflowExecut
6767
6868 for _ , be := range req .State .BufferedEvents {
6969 bufferedEventsCount ++
70+
71+ if be == nil {
72+ continue
73+ }
74+
7075 bufferedEventsSize += len (be .Data )
7176 }
7277
@@ -182,6 +187,10 @@ func (sc *statsComputer) computeMutableStateUpdateStats(req *InternalUpdateWorkf
182187}
183188
184189func computeExecutionInfoSize (executionInfo * InternalWorkflowExecutionInfo ) int {
190+ if executionInfo == nil {
191+ return 0
192+ }
193+
185194 size := len (executionInfo .WorkflowID )
186195 size += len (executionInfo .TaskQueue )
187196 size += len (executionInfo .WorkflowTypeName )
@@ -191,6 +200,10 @@ func computeExecutionInfoSize(executionInfo *InternalWorkflowExecutionInfo) int
191200}
192201
193202func computeActivityInfoSize (ai * persistenceblobs.ActivityInfo ) int {
203+ if ai == nil {
204+ return 0
205+ }
206+
194207 size := len (ai .ActivityId )
195208 if ai .ScheduledEvent != nil {
196209 size += ai .ScheduledEvent .Size ()
@@ -206,12 +219,19 @@ func computeActivityInfoSize(ai *persistenceblobs.ActivityInfo) int {
206219}
207220
208221func computeTimerInfoSize (ti * persistenceblobs.TimerInfo ) int {
222+ if ti == nil {
223+ return 0
224+ }
225+
209226 size := len (ti .GetTimerId ())
210227
211228 return size
212229}
213230
214231func computeChildInfoSize (ci * persistenceblobs.ChildExecutionInfo ) int {
232+ if ci == nil {
233+ return 0
234+ }
215235 size := 0
216236 if ci .InitiatedEvent != nil {
217237 size += ci .InitiatedEvent .Size ()
@@ -223,6 +243,10 @@ func computeChildInfoSize(ci *persistenceblobs.ChildExecutionInfo) int {
223243}
224244
225245func computeSignalInfoSize (si * persistenceblobs.SignalInfo ) int {
246+ if si == nil {
247+ return 0
248+ }
249+
226250 size := len (si .Name )
227251 size += si .GetInput ().Size ()
228252 size += len (si .Control )
0 commit comments